Trait capsules_extra::net::icmpv6::icmpv6_send::ICMP6Sender

source ·
pub trait ICMP6Sender<'a> {
    // Required methods
    fn set_client(&self, client: &'a dyn ICMP6SendClient);
    fn send(
        &self,
        dest: IPAddr,
        icmp_header: ICMP6Header,
        buf: &'static mut [u8],
        net_cap: &'static NetworkCapability,
    ) -> Result<(), ErrorCode>;
}
Expand description

A trait that defines an interface for sending ICMPv6 packets.

Required Methods§

source

fn set_client(&self, client: &'a dyn ICMP6SendClient)

Sets the client for the ICMP6Sender instance.

§Arguments

client - The ICMP6SendClient instance to be set as the client of the ICMP6Sender instance

source

fn send( &self, dest: IPAddr, icmp_header: ICMP6Header, buf: &'static mut [u8], net_cap: &'static NetworkCapability, ) -> Result<(), ErrorCode>

Constructs and sends an IP packet from provided ICMPv6 header and payload.

§Arguments

dest - The destination IP address icmp_header - The ICMPv6 header to be sent buf - The byte array containing the ICMPv6 payload

§Return Value

This function returns a code reporting either success or any synchronous errors. Note that any asynchronous errors are returned via the callback.

Implementors§

source§

impl<'a, T: IP6Sender<'a>> ICMP6Sender<'a> for ICMP6SendStruct<'a, T>