pub struct FakeIpSocketCtx<I: Ip, D> { /* private fields */ }
Expand description
A fake implementation of the traits required by the transport layer from the IP layer.
Implementations§
Source§impl<I: IpExt, D: FakeStrongDeviceId> FakeIpSocketCtx<I, D>
impl<I: IpExt, D: FakeStrongDeviceId> FakeIpSocketCtx<I, D>
Sourcepub fn new(
device_configs: impl IntoIterator<Item = FakeDeviceConfig<D, SpecifiedAddr<I::Addr>>>,
) -> Self
pub fn new( device_configs: impl IntoIterator<Item = FakeDeviceConfig<D, SpecifiedAddr<I::Addr>>>, ) -> Self
Creates a new FakeIpSocketCtx
with the given device
configs.
Sourcepub fn get_device_state(&self, device: &D) -> &FakeDeviceState<I>
pub fn get_device_state(&self, device: &D) -> &FakeDeviceState<I>
Returns an immutable reference to the fake device state.
Sourcepub fn get_device_state_mut(&mut self, device: &D) -> &mut FakeDeviceState<I>
pub fn get_device_state_mut(&mut self, device: &D) -> &mut FakeDeviceState<I>
Returns a mutable reference to the fake device state.
Trait Implementations§
Source§impl<I: IpExt, D: FakeStrongDeviceId, BC> BaseTransportIpContext<I, BC> for FakeIpSocketCtx<I, D>
impl<I: IpExt, D: FakeStrongDeviceId, BC> BaseTransportIpContext<I, BC> for FakeIpSocketCtx<I, D>
Source§type DevicesWithAddrIter<'a> = Box<dyn Iterator<Item = D> + 'a>
type DevicesWithAddrIter<'a> = Box<dyn Iterator<Item = D> + 'a>
The iterator given to
BaseTransportIpContext::with_devices_with_assigned_addr
.Source§fn get_default_hop_limits(&mut self, device: Option<&D>) -> HopLimits
fn get_default_hop_limits(&mut self, device: Option<&D>) -> HopLimits
Get default hop limits. Read more
Source§fn with_devices_with_assigned_addr<O, F: FnOnce(Self::DevicesWithAddrIter<'_>) -> O>(
&mut self,
addr: SpecifiedAddr<I::Addr>,
cb: F,
) -> O
fn with_devices_with_assigned_addr<O, F: FnOnce(Self::DevicesWithAddrIter<'_>) -> O>( &mut self, addr: SpecifiedAddr<I::Addr>, cb: F, ) -> O
Is this one of our local addresses, and is it in the assigned state? Read more
Source§impl<I: Ip, D> Default for FakeIpSocketCtx<I, D>
impl<I: Ip, D> Default for FakeIpSocketCtx<I, D>
Source§impl<I: IpExt, D: FakeStrongDeviceId> DeviceIdContext<AnyDevice> for FakeIpSocketCtx<I, D>
impl<I: IpExt, D: FakeStrongDeviceId> DeviceIdContext<AnyDevice> for FakeIpSocketCtx<I, D>
Source§type WeakDeviceId = <D as StrongDeviceIdentifier>::Weak
type WeakDeviceId = <D as StrongDeviceIdentifier>::Weak
The type of weakly referenced device IDs.
Source§impl<I: Ip, D, IpType> GenericOverIp<IpType> for FakeIpSocketCtx<I, D>where
IpType: Ip,
impl<I: Ip, D, IpType> GenericOverIp<IpType> for FakeIpSocketCtx<I, D>where
IpType: Ip,
Source§type Type = FakeIpSocketCtx<IpType, D>
type Type = FakeIpSocketCtx<IpType, D>
The type of
Self
when its IP-generic parameter is replaced with the
type NewIp
.Source§impl<I: Ip, D> InnerFakeIpSocketCtx<I, D> for FakeIpSocketCtx<I, D>
impl<I: Ip, D> InnerFakeIpSocketCtx<I, D> for FakeIpSocketCtx<I, D>
Source§fn fake_ip_socket_ctx_mut(&mut self) -> &mut FakeIpSocketCtx<I, D>
fn fake_ip_socket_ctx_mut(&mut self) -> &mut FakeIpSocketCtx<I, D>
Gets a mutable reference to the inner fake context.
Source§impl<I: IpExt, D: FakeStrongDeviceId, BC> MulticastMembershipHandler<I, BC> for FakeIpSocketCtx<I, D>
impl<I: IpExt, D: FakeStrongDeviceId, BC> MulticastMembershipHandler<I, BC> for FakeIpSocketCtx<I, D>
Source§fn join_multicast_group(
&mut self,
_bindings_ctx: &mut BC,
device: &Self::DeviceId,
addr: MulticastAddr<<I as Ip>::Addr>,
)
fn join_multicast_group( &mut self, _bindings_ctx: &mut BC, device: &Self::DeviceId, addr: MulticastAddr<<I as Ip>::Addr>, )
Requests that the specified device join the given multicast group. Read more
Source§fn leave_multicast_group(
&mut self,
_bindings_ctx: &mut BC,
device: &Self::DeviceId,
addr: MulticastAddr<<I as Ip>::Addr>,
)
fn leave_multicast_group( &mut self, _bindings_ctx: &mut BC, device: &Self::DeviceId, addr: MulticastAddr<<I as Ip>::Addr>, )
Requests that the specified device leave the given multicast group. Read more
Source§fn select_device_for_multicast_group(
&mut self,
addr: MulticastAddr<<I as Ip>::Addr>,
_marks: &Marks,
) -> Result<Self::DeviceId, ResolveRouteError>
fn select_device_for_multicast_group( &mut self, addr: MulticastAddr<<I as Ip>::Addr>, _marks: &Marks, ) -> Result<Self::DeviceId, ResolveRouteError>
Selects a default device with which to join the given multicast group. Read more
Auto Trait Implementations§
impl<I, D> Freeze for FakeIpSocketCtx<I, D>
impl<I, D> !RefUnwindSafe for FakeIpSocketCtx<I, D>
impl<I, D> Send for FakeIpSocketCtx<I, D>where
D: Send,
impl<I, D> !Sync for FakeIpSocketCtx<I, D>
impl<I, D> Unpin for FakeIpSocketCtx<I, D>
impl<I, D> !UnwindSafe for FakeIpSocketCtx<I, D>
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
Source§impl<O, BC> BuildableCoreContext<BC> for Owhere
O: Default,
impl<O, BC> BuildableCoreContext<BC> for Owhere
O: Default,
§impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
§impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<CC, BC, Meta> RecvFrameContext<Meta, BC> for CCwhere
Meta: ReceivableFrameMeta<CC, BC>,
impl<CC, BC, Meta> RecvFrameContext<Meta, BC> for CCwhere
Meta: ReceivableFrameMeta<CC, BC>,
Source§impl<CC, BC, Meta> SendFrameContext<BC, Meta> for CCwhere
Meta: SendableFrameMeta<CC, BC>,
impl<CC, BC, Meta> SendFrameContext<BC, Meta> for CCwhere
Meta: SendableFrameMeta<CC, BC>,
Source§fn send_frame<S>(
&mut self,
bindings_ctx: &mut BC,
metadata: Meta,
frame: S,
) -> Result<(), ErrorAndSerializer<SendFrameErrorReason, S>>
fn send_frame<S>( &mut self, bindings_ctx: &mut BC, metadata: Meta, frame: S, ) -> Result<(), ErrorAndSerializer<SendFrameErrorReason, S>>
Send a frame. Read more
Source§impl<BC, S, Meta, DeviceId> SendableFrameMeta<FakeCoreCtx<S, Meta, DeviceId>, BC> for Meta
impl<BC, S, Meta, DeviceId> SendableFrameMeta<FakeCoreCtx<S, Meta, DeviceId>, BC> for Meta
Source§fn send_meta<SS>(
self,
core_ctx: &mut FakeCoreCtx<S, Meta, DeviceId>,
bindings_ctx: &mut BC,
frame: SS,
) -> Result<(), ErrorAndSerializer<SendFrameErrorReason, SS>>
fn send_meta<SS>( self, core_ctx: &mut FakeCoreCtx<S, Meta, DeviceId>, bindings_ctx: &mut BC, frame: SS, ) -> Result<(), ErrorAndSerializer<SendFrameErrorReason, SS>>
Sends this frame metadata to the provided contexts.
Source§impl<Meta, BC> SendableFrameMeta<FakeFrameCtx<Meta>, BC> for Meta
impl<Meta, BC> SendableFrameMeta<FakeFrameCtx<Meta>, BC> for Meta
Source§fn send_meta<S>(
self,
core_ctx: &mut FakeFrameCtx<Meta>,
_bindings_ctx: &mut BC,
frame: S,
) -> Result<(), ErrorAndSerializer<SendFrameErrorReason, S>>
fn send_meta<S>( self, core_ctx: &mut FakeFrameCtx<Meta>, _bindings_ctx: &mut BC, frame: S, ) -> Result<(), ErrorAndSerializer<SendFrameErrorReason, S>>
Sends this frame metadata to the provided contexts.
Source§impl<Id, CC, BC> TimerHandler<BC, Id> for CCwhere
BC: TimerBindingsTypes,
Id: HandleableTimer<CC, BC>,
impl<Id, CC, BC> TimerHandler<BC, Id> for CCwhere
BC: TimerBindingsTypes,
Id: HandleableTimer<CC, BC>,
Source§fn handle_timer(
&mut self,
bindings_ctx: &mut BC,
dispatch: Id,
timer: <BC as TimerBindingsTypes>::UniqueTimerId,
)
fn handle_timer( &mut self, bindings_ctx: &mut BC, dispatch: Id, timer: <BC as TimerBindingsTypes>::UniqueTimerId, )
Handle a timer firing. Read more
Source§impl<L, T> UnlockedAccess<L> for Twhere
L: UnlockedAccessMarkerFor<T>,
impl<L, T> UnlockedAccess<L> for Twhere
L: UnlockedAccessMarkerFor<T>,
Source§type Data = <L as UnlockedAccessMarkerFor<T>>::Data
type Data = <L as UnlockedAccessMarkerFor<T>>::Data
The type of state being accessed.
Source§type Guard<'l> = &'l <L as UnlockedAccessMarkerFor<T>>::Data
where
T: 'l
type Guard<'l> = &'l <L as UnlockedAccessMarkerFor<T>>::Data where T: 'l
A guard providing read access to the data.
Source§fn access(&self) -> <T as UnlockedAccess<L>>::Guard<'_>
fn access(&self) -> <T as UnlockedAccess<L>>::Guard<'_>
How to access the state.