pub struct FakeEventDispatcherBuilder { /* private fields */ }
Expand description
A builder for FakeEventDispatcher
s.
A FakeEventDispatcherBuilder
is capable of storing the configuration of a
network stack including forwarding table entries, devices and their assigned
addresses and configurations, ARP table entries, etc. It can be built using
build
, producing a Context<FakeEventDispatcher>
with all of the
appropriate state configured.
Implementations§
source§impl FakeEventDispatcherBuilder
impl FakeEventDispatcherBuilder
sourcepub fn add_device(&mut self, mac: UnicastAddr<Mac>) -> usize
pub fn add_device(&mut self, mac: UnicastAddr<Mac>) -> usize
Add a device.
add_device
returns a key which can be used to refer to the device in
future calls to add_arp_table_entry
and add_device_route
.
sourcepub fn add_device_with_ip<A: IpAddress>(
&mut self,
mac: UnicastAddr<Mac>,
ip: A,
subnet: Subnet<A>
) -> usize
pub fn add_device_with_ip<A: IpAddress>( &mut self, mac: UnicastAddr<Mac>, ip: A, subnet: Subnet<A> ) -> usize
Add a device with an associated IP address.
add_device_with_ip
is like add_device
, except that it takes an
associated IP address and subnet to assign to the device.
sourcepub fn build(self) -> (FakeCtx, Vec<EthernetDeviceId<FakeBindingsCtx>>)
pub fn build(self) -> (FakeCtx, Vec<EthernetDeviceId<FakeBindingsCtx>>)
Builds a Ctx
from the present configuration with a default dispatcher.
Trait Implementations§
source§impl Clone for FakeEventDispatcherBuilder
impl Clone for FakeEventDispatcherBuilder
source§fn clone(&self) -> FakeEventDispatcherBuilder
fn clone(&self) -> FakeEventDispatcherBuilder
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Default for FakeEventDispatcherBuilder
impl Default for FakeEventDispatcherBuilder
source§fn default() -> FakeEventDispatcherBuilder
fn default() -> FakeEventDispatcherBuilder
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for FakeEventDispatcherBuilder
impl RefUnwindSafe for FakeEventDispatcherBuilder
impl Send for FakeEventDispatcherBuilder
impl Sync for FakeEventDispatcherBuilder
impl Unpin for FakeEventDispatcherBuilder
impl UnwindSafe for FakeEventDispatcherBuilder
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.