pub trait RsContext<BC: RsBindingsTypes>: DeviceIdContext<AnyDevice> + CoreTimerContext<RsTimerId<Self::WeakDeviceId>, BC> {
type LinkLayerAddr: Ipv6LinkLayerAddr;
// Required methods
fn with_rs_state_mut_and_max<O, F: FnOnce(&mut RsState<BC>, Option<NonZeroU8>) -> O>(
&mut self,
device_id: &Self::DeviceId,
cb: F,
) -> O;
fn get_link_layer_addr(
&mut self,
device_id: &Self::DeviceId,
) -> Option<Self::LinkLayerAddr>;
fn send_rs_packet<S: NetworkSerializer<Buffer = EmptyBuf> + NetworkPartialSerializer, F: FnOnce(Option<UnicastAddr<Ipv6Addr>>) -> S>(
&mut self,
bindings_ctx: &mut BC,
device_id: &Self::DeviceId,
message: RouterSolicitation,
body: F,
) -> Result<(), IpSendFrameError<S>>;
// Provided method
fn with_rs_state_mut<O, F: FnOnce(&mut RsState<BC>) -> O>(
&mut self,
device_id: &Self::DeviceId,
cb: F,
) -> O { ... }
}Expand description
The execution context for router solicitation.
Required Associated Types§
Sourcetype LinkLayerAddr: Ipv6LinkLayerAddr
type LinkLayerAddr: Ipv6LinkLayerAddr
A link-layer address.
Required Methods§
Sourcefn with_rs_state_mut_and_max<O, F: FnOnce(&mut RsState<BC>, Option<NonZeroU8>) -> O>(
&mut self,
device_id: &Self::DeviceId,
cb: F,
) -> O
fn with_rs_state_mut_and_max<O, F: FnOnce(&mut RsState<BC>, Option<NonZeroU8>) -> O>( &mut self, device_id: &Self::DeviceId, cb: F, ) -> O
Calls the callback with a mutable reference to the router solicitation state and the maximum number of router solications to send.
Sourcefn get_link_layer_addr(
&mut self,
device_id: &Self::DeviceId,
) -> Option<Self::LinkLayerAddr>
fn get_link_layer_addr( &mut self, device_id: &Self::DeviceId, ) -> Option<Self::LinkLayerAddr>
Gets the device’s link-layer address, if the device supports link-layer addressing.
Sourcefn send_rs_packet<S: NetworkSerializer<Buffer = EmptyBuf> + NetworkPartialSerializer, F: FnOnce(Option<UnicastAddr<Ipv6Addr>>) -> S>(
&mut self,
bindings_ctx: &mut BC,
device_id: &Self::DeviceId,
message: RouterSolicitation,
body: F,
) -> Result<(), IpSendFrameError<S>>
fn send_rs_packet<S: NetworkSerializer<Buffer = EmptyBuf> + NetworkPartialSerializer, F: FnOnce(Option<UnicastAddr<Ipv6Addr>>) -> S>( &mut self, bindings_ctx: &mut BC, device_id: &Self::DeviceId, message: RouterSolicitation, body: F, ) -> Result<(), IpSendFrameError<S>>
Sends an NDP Router Solicitation to the local-link.
The callback is called with a source address suitable for an outgoing router solicitation message and returns the message body.
Provided Methods§
Sourcefn with_rs_state_mut<O, F: FnOnce(&mut RsState<BC>) -> O>(
&mut self,
device_id: &Self::DeviceId,
cb: F,
) -> O
fn with_rs_state_mut<O, F: FnOnce(&mut RsState<BC>) -> O>( &mut self, device_id: &Self::DeviceId, cb: F, ) -> O
Calls the callback with a mutable reference to the router solicitation state.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".