pub trait IpRouteTablesContext<I: IpLayerIpExt, BT: IpRoutingBindingsTypes>: IpRouteTableContext<I, BT> + IpDeviceContext<I> {
type Ctx<'a>: IpRouteTableContext<I, BT, DeviceId = Self::DeviceId, WeakDeviceId = Self::WeakDeviceId>;
// Required methods
fn main_table_id(&self) -> RoutingTableId<I, Self::DeviceId, BT>;
fn with_ip_routing_tables<O, F: FnOnce(&mut Self::Ctx<'_>, &HashMap<RoutingTableId<I, Self::DeviceId, BT>, PrimaryRc<BaseRoutingTableState<I, Self::DeviceId, BT>>>) -> O>(
&mut self,
cb: F,
) -> O;
fn with_ip_routing_tables_mut<O, F: FnOnce(&mut HashMap<RoutingTableId<I, Self::DeviceId, BT>, PrimaryRc<BaseRoutingTableState<I, Self::DeviceId, BT>>>) -> O>(
&mut self,
cb: F,
) -> O;
// Provided methods
fn with_main_ip_routing_table<O, F: FnOnce(&mut Self::IpDeviceIdCtx<'_>, &RoutingTable<I, Self::DeviceId>) -> O>(
&mut self,
cb: F,
) -> O { ... }
fn with_main_ip_routing_table_mut<O, F: FnOnce(&mut Self::IpDeviceIdCtx<'_>, &mut RoutingTable<I, Self::DeviceId>) -> O>(
&mut self,
cb: F,
) -> O { ... }
}Expand description
The state context that gives access to routing tables provided to the IP layer.
Required Associated Types§
Sourcetype Ctx<'a>: IpRouteTableContext<I, BT, DeviceId = Self::DeviceId, WeakDeviceId = Self::WeakDeviceId>
type Ctx<'a>: IpRouteTableContext<I, BT, DeviceId = Self::DeviceId, WeakDeviceId = Self::WeakDeviceId>
The inner context that can provide access to individual routing tables.
Required Methods§
Sourcefn main_table_id(&self) -> RoutingTableId<I, Self::DeviceId, BT>
fn main_table_id(&self) -> RoutingTableId<I, Self::DeviceId, BT>
Gets the main table ID.
Sourcefn with_ip_routing_tables<O, F: FnOnce(&mut Self::Ctx<'_>, &HashMap<RoutingTableId<I, Self::DeviceId, BT>, PrimaryRc<BaseRoutingTableState<I, Self::DeviceId, BT>>>) -> O>(
&mut self,
cb: F,
) -> O
fn with_ip_routing_tables<O, F: FnOnce(&mut Self::Ctx<'_>, &HashMap<RoutingTableId<I, Self::DeviceId, BT>, PrimaryRc<BaseRoutingTableState<I, Self::DeviceId, BT>>>) -> O>( &mut self, cb: F, ) -> O
Gets immutable access to all the routing tables that currently exist.
Sourcefn with_ip_routing_tables_mut<O, F: FnOnce(&mut HashMap<RoutingTableId<I, Self::DeviceId, BT>, PrimaryRc<BaseRoutingTableState<I, Self::DeviceId, BT>>>) -> O>(
&mut self,
cb: F,
) -> O
fn with_ip_routing_tables_mut<O, F: FnOnce(&mut HashMap<RoutingTableId<I, Self::DeviceId, BT>, PrimaryRc<BaseRoutingTableState<I, Self::DeviceId, BT>>>) -> O>( &mut self, cb: F, ) -> O
Gets mutable access to all the routing tables that currently exist.
Provided Methods§
Sourcefn with_main_ip_routing_table<O, F: FnOnce(&mut Self::IpDeviceIdCtx<'_>, &RoutingTable<I, Self::DeviceId>) -> O>(
&mut self,
cb: F,
) -> O
fn with_main_ip_routing_table<O, F: FnOnce(&mut Self::IpDeviceIdCtx<'_>, &RoutingTable<I, Self::DeviceId>) -> O>( &mut self, cb: F, ) -> O
Calls the function with an immutable reference to IP routing table.
Sourcefn with_main_ip_routing_table_mut<O, F: FnOnce(&mut Self::IpDeviceIdCtx<'_>, &mut RoutingTable<I, Self::DeviceId>) -> O>(
&mut self,
cb: F,
) -> O
fn with_main_ip_routing_table_mut<O, F: FnOnce(&mut Self::IpDeviceIdCtx<'_>, &mut RoutingTable<I, Self::DeviceId>) -> O>( &mut self, 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".