netstack3_ip

Trait IpRouteTableContext

Source
pub trait IpRouteTableContext<I: IpLayerIpExt>: IpDeviceContext<I> {
    type IpDeviceIdCtx<'a>: DeviceIdContext<AnyDevice, DeviceId = Self::DeviceId, WeakDeviceId = Self::WeakDeviceId> + IpRoutingDeviceContext<I> + IpDeviceContext<I>;

    // Required methods
    fn with_ip_routing_table<O, F: FnOnce(&mut Self::IpDeviceIdCtx<'_>, &RoutingTable<I, Self::DeviceId>) -> O>(
        &mut self,
        table_id: &RoutingTableId<I, Self::DeviceId>,
        cb: F,
    ) -> O;
    fn with_ip_routing_table_mut<O, F: FnOnce(&mut Self::IpDeviceIdCtx<'_>, &mut RoutingTable<I, Self::DeviceId>) -> O>(
        &mut self,
        table_id: &RoutingTableId<I, Self::DeviceId>,
        cb: F,
    ) -> O;
}
Expand description

The state context that gives access to a singular routing table.

Required Associated Types§

Source

type IpDeviceIdCtx<'a>: DeviceIdContext<AnyDevice, DeviceId = Self::DeviceId, WeakDeviceId = Self::WeakDeviceId> + IpRoutingDeviceContext<I> + IpDeviceContext<I>

The inner device id context.

Required Methods§

Source

fn with_ip_routing_table<O, F: FnOnce(&mut Self::IpDeviceIdCtx<'_>, &RoutingTable<I, Self::DeviceId>) -> O>( &mut self, table_id: &RoutingTableId<I, Self::DeviceId>, cb: F, ) -> O

Calls the function with an immutable reference to IP routing table.

Source

fn with_ip_routing_table_mut<O, F: FnOnce(&mut Self::IpDeviceIdCtx<'_>, &mut RoutingTable<I, Self::DeviceId>) -> O>( &mut self, table_id: &RoutingTableId<I, Self::DeviceId>, cb: F, ) -> O

Calls the function with a mutable reference to IP routing table.

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§