netstack3_ip

Trait IpStateContext

Source
pub trait IpStateContext<I: IpLayerIpExt>: IpRouteTablesContext<I, DeviceId: DeviceWithName> {
    type IpRouteTablesCtx<'a>: IpRouteTablesContext<I, DeviceId = Self::DeviceId>;

    // Required methods
    fn with_rules_table<O, F: FnOnce(&mut Self::IpRouteTablesCtx<'_>, &RulesTable<I, Self::DeviceId>) -> O>(
        &mut self,
        cb: F,
    ) -> O;
    fn with_rules_table_mut<O, F: FnOnce(&mut Self::IpRouteTablesCtx<'_>, &mut RulesTable<I, Self::DeviceId>) -> O>(
        &mut self,
        cb: F,
    ) -> O;
}
Expand description

The state context provided to the IP layer.

Required Associated Types§

Source

type IpRouteTablesCtx<'a>: IpRouteTablesContext<I, DeviceId = Self::DeviceId>

The context that provides access to the IP routing tables.

Required Methods§

Source

fn with_rules_table<O, F: FnOnce(&mut Self::IpRouteTablesCtx<'_>, &RulesTable<I, Self::DeviceId>) -> O>( &mut self, cb: F, ) -> O

Gets an immutable reference to the rules table.

Source

fn with_rules_table_mut<O, F: FnOnce(&mut Self::IpRouteTablesCtx<'_>, &mut RulesTable<I, Self::DeviceId>) -> O>( &mut self, cb: F, ) -> O

Gets a mutable reference to the rules 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§