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§
Sourcefn set_client(&self, client: &'a dyn ICMP6SendClient)
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
Sourcefn send(
&self,
dest: IPAddr,
icmp_header: ICMP6Header,
buf: &'static mut [u8],
net_cap: &'static NetworkCapability,
) -> Result<(), ErrorCode>
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.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".