Struct netstack3_core::testutil::TestApi
source · pub struct TestApi<'a, BT: BindingsTypes>(/* private fields */);
Expand description
An API struct for test utilities.
Implementations§
source§impl<'l, BC> TestApi<'l, BC>where
BC: BindingsContext,
impl<'l, BC> TestApi<'l, BC>where
BC: BindingsContext,
sourcepub fn add_route(
&mut self,
entry: AddableEntryEither<DeviceId<BC>>
) -> Result<(), AddRouteError>
pub fn add_route( &mut self, entry: AddableEntryEither<DeviceId<BC>> ) -> Result<(), AddRouteError>
Add a route directly to the forwarding table.
sourcepub fn del_routes_to_subnet(&mut self, subnet: SubnetEither) -> Result<()>
pub fn del_routes_to_subnet(&mut self, subnet: SubnetEither) -> Result<()>
Delete a route from the forwarding table, returning Err
if no route
was found to be deleted.
sourcepub fn clear_routes_and_remove_ethernet_device(
&mut self,
ethernet_device: EthernetDeviceId<BC>
)
pub fn clear_routes_and_remove_ethernet_device( &mut self, ethernet_device: EthernetDeviceId<BC> )
Removes all of the routes through the device, then removes the device.
Auto Trait Implementations§
impl<'a, BT> Freeze for TestApi<'a, BT>where
BT: TimerBindingsTypes<DispatchId = TimerId<BT>> + UdpBindingsTypes + IcmpBindingsTypes + IcmpEchoBindingsTypes + FilterBindingsTypes + TcpBindingsTypes + DeviceLayerTypes + ReferenceNotifiers + LinkResolutionContext<EthernetLinkDevice> + DeviceSocketTypes + DeviceLayerStateTypes + InstantContext + InstantBindingsTypes + 'static,
impl<'a, BT> RefUnwindSafe for TestApi<'a, BT>where
BT: TimerBindingsTypes<DispatchId = TimerId<BT>> + UdpBindingsTypes + IcmpBindingsTypes + IcmpEchoBindingsTypes + FilterBindingsTypes + TcpBindingsTypes + DeviceLayerTypes + ReferenceNotifiers + LinkResolutionContext<EthernetLinkDevice> + DeviceSocketTypes + DeviceLayerStateTypes + InstantContext + InstantBindingsTypes + 'static + RefUnwindSafe,
<BT as InstantBindingsTypes>::Instant: RefUnwindSafe,
impl<'a, BT> Send for TestApi<'a, BT>where
BT: TimerBindingsTypes<DispatchId = TimerId<BT>> + UdpBindingsTypes + IcmpBindingsTypes + IcmpEchoBindingsTypes + FilterBindingsTypes + TcpBindingsTypes + DeviceLayerTypes + ReferenceNotifiers + LinkResolutionContext<EthernetLinkDevice> + DeviceSocketTypes + DeviceLayerStateTypes + InstantContext + InstantBindingsTypes + 'static + Send,
<BT as FilterBindingsTypes>::DeviceClass: Sync + Send,
impl<'a, BT> Sync for TestApi<'a, BT>where
BT: TimerBindingsTypes<DispatchId = TimerId<BT>> + UdpBindingsTypes + IcmpBindingsTypes + IcmpEchoBindingsTypes + FilterBindingsTypes + TcpBindingsTypes + DeviceLayerTypes + ReferenceNotifiers + LinkResolutionContext<EthernetLinkDevice> + DeviceSocketTypes + DeviceLayerStateTypes + InstantContext + InstantBindingsTypes + 'static + Sync,
<BT as FilterBindingsTypes>::DeviceClass: Sync + Send,
impl<'a, BT> Unpin for TestApi<'a, BT>where
BT: TimerBindingsTypes<DispatchId = TimerId<BT>> + UdpBindingsTypes + IcmpBindingsTypes + IcmpEchoBindingsTypes + FilterBindingsTypes + TcpBindingsTypes + DeviceLayerTypes + ReferenceNotifiers + LinkResolutionContext<EthernetLinkDevice> + DeviceSocketTypes + DeviceLayerStateTypes + InstantContext + InstantBindingsTypes + 'static,
impl<'a, BT> !UnwindSafe for TestApi<'a, BT>
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<Id, CC, BC> TimerHandler<BC, Id> for CCwhere
Id: HandleableTimer<CC, BC>,
impl<Id, CC, BC> TimerHandler<BC, Id> for CCwhere
Id: HandleableTimer<CC, BC>,
source§fn handle_timer(&mut self, bindings_ctx: &mut BC, id: Id)
fn handle_timer(&mut self, bindings_ctx: &mut BC, id: Id)
Handle a timer firing.