Trait netstack3_ip::IpRouteTablesContext
source · pub trait IpRouteTablesContext<I: IpLayerIpExt>: IpDeviceContext<I> {
type IpDeviceIdCtx<'a>: DeviceIdContext<AnyDevice, DeviceId = Self::DeviceId, WeakDeviceId = Self::WeakDeviceId> + IpRoutingDeviceContext<I> + IpDeviceStateContext<I> + IpDeviceContext<I>;
// Required methods
fn main_table_id(&self) -> RoutingTableId<I, Self::DeviceId>;
fn with_ip_routing_tables_mut<O, F: FnOnce(&mut HashMap<RoutingTableId<I, Self::DeviceId>, PrimaryRc<RwLock<RoutingTable<I, Self::DeviceId>>>>) -> O>(
&mut self,
cb: F,
) -> O;
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;
// 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 IpDeviceIdCtx<'a>: DeviceIdContext<AnyDevice, DeviceId = Self::DeviceId, WeakDeviceId = Self::WeakDeviceId> + IpRoutingDeviceContext<I> + IpDeviceStateContext<I> + IpDeviceContext<I>
type IpDeviceIdCtx<'a>: DeviceIdContext<AnyDevice, DeviceId = Self::DeviceId, WeakDeviceId = Self::WeakDeviceId> + IpRoutingDeviceContext<I> + IpDeviceStateContext<I> + IpDeviceContext<I>
The inner device id context.
Required Methods§
sourcefn main_table_id(&self) -> RoutingTableId<I, Self::DeviceId>
fn main_table_id(&self) -> RoutingTableId<I, Self::DeviceId>
Gets the main table ID.
sourcefn with_ip_routing_tables_mut<O, F: FnOnce(&mut HashMap<RoutingTableId<I, Self::DeviceId>, PrimaryRc<RwLock<RoutingTable<I, Self::DeviceId>>>>) -> O>(
&mut self,
cb: F,
) -> O
fn with_ip_routing_tables_mut<O, F: FnOnce(&mut HashMap<RoutingTableId<I, Self::DeviceId>, PrimaryRc<RwLock<RoutingTable<I, Self::DeviceId>>>>) -> O>( &mut self, cb: F, ) -> O
Gets mutable access to all the routing tables that currently exist.
sourcefn 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<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.
sourcefn 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
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.
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.
Object Safety§
This trait is not object safe.