Skip to main content

IpStateContext

Trait IpStateContext 

Source
pub trait IpStateContext<I: IpLayerIpExt, BT: IpRoutingBindingsTypes + MatcherBindingsTypes>: IpRouteTablesContext<I, BT, DeviceId: InterfaceProperties<BT::DeviceClass>> {
    type IpRouteTablesCtx<'a>: IpRouteTablesContext<I, BT, DeviceId = Self::DeviceId>;

    // Required methods
    fn with_rules_table<O, F: FnOnce(&mut Self::IpRouteTablesCtx<'_>, &RulesTable<I, Self::DeviceId, BT>) -> O>(
        &mut self,
        cb: F,
    ) -> O;
    fn with_rules_table_mut<O, F: FnOnce(&mut Self::IpRouteTablesCtx<'_>, &mut RulesTable<I, Self::DeviceId, BT>) -> 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, BT, 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, BT>) -> 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, BT>) -> 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".

Implementors§