netstack3_ip::nud

Trait NudContext

Source
pub trait NudContext<I: Ip, D: LinkDevice, BC: NudBindingsTypes<D>>: DeviceIdContext<D> {
    type ConfigCtx<'a>: NudConfigContext<I>;
    type SenderCtx<'a>: NudSenderContext<I, D, BC, DeviceId = Self::DeviceId>;

    // Required methods
    fn with_nud_state_mut_and_sender_ctx<O, F: FnOnce(&mut NudState<I, D, BC>, &mut Self::SenderCtx<'_>) -> O>(
        &mut self,
        device_id: &Self::DeviceId,
        cb: F,
    ) -> O;
    fn with_nud_state_mut<O, F: FnOnce(&mut NudState<I, D, BC>, &mut Self::ConfigCtx<'_>) -> O>(
        &mut self,
        device_id: &Self::DeviceId,
        cb: F,
    ) -> O;
    fn with_nud_state<O, F: FnOnce(&NudState<I, D, BC>) -> O>(
        &mut self,
        device_id: &Self::DeviceId,
        cb: F,
    ) -> O;
    fn send_neighbor_solicitation(
        &mut self,
        bindings_ctx: &mut BC,
        device_id: &Self::DeviceId,
        lookup_addr: SpecifiedAddr<I::Addr>,
        remote_link_addr: Option<D::Address>,
    );
}
Expand description

The execution context for NUD for a link device.

Required Associated Types§

Source

type ConfigCtx<'a>: NudConfigContext<I>

The inner configuration context.

Source

type SenderCtx<'a>: NudSenderContext<I, D, BC, DeviceId = Self::DeviceId>

The inner send context.

Required Methods§

Source

fn with_nud_state_mut_and_sender_ctx<O, F: FnOnce(&mut NudState<I, D, BC>, &mut Self::SenderCtx<'_>) -> O>( &mut self, device_id: &Self::DeviceId, cb: F, ) -> O

Calls the function with a mutable reference to the NUD state and the core sender context.

Source

fn with_nud_state_mut<O, F: FnOnce(&mut NudState<I, D, BC>, &mut Self::ConfigCtx<'_>) -> O>( &mut self, device_id: &Self::DeviceId, cb: F, ) -> O

Calls the function with a mutable reference to the NUD state and NUD configuration for the device.

Source

fn with_nud_state<O, F: FnOnce(&NudState<I, D, BC>) -> O>( &mut self, device_id: &Self::DeviceId, cb: F, ) -> O

Calls the function with an immutable reference to the NUD state.

Source

fn send_neighbor_solicitation( &mut self, bindings_ctx: &mut BC, device_id: &Self::DeviceId, lookup_addr: SpecifiedAddr<I::Addr>, remote_link_addr: Option<D::Address>, )

Sends a neighbor probe/solicitation message.

If remote_link_addr is provided, the message will be unicasted to that address; if it is None, the message will be multicast.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<I, D, BC, CC> NudContext<I, D, BC> for CC
where I: Ip, D: LinkDevice, BC: NudBindingsTypes<D>, CC: DelegateNudContext<I, Delegate<CC>: NudContext<I, D, BC, DeviceId = CC::DeviceId>> + UseDelegateNudContext + DeviceIdContext<D>,

Source§

type ConfigCtx<'a> = <<CC as DelegateNudContext<I>>::Delegate<CC> as NudContext<I, D, BC>>::ConfigCtx<'a>

Source§

type SenderCtx<'a> = <<CC as DelegateNudContext<I>>::Delegate<CC> as NudContext<I, D, BC>>::SenderCtx<'a>