pub enum DeviceId<BT>where
BT: DeviceLayerTypes,{
Ethernet(BaseDeviceId<EthernetLinkDevice, BT>),
Loopback(BaseDeviceId<LoopbackDevice, BT>),
PureIp(BaseDeviceId<PureIpDevice, BT>),
Blackhole(BaseDeviceId<BlackholeDevice, BT>),
}
Expand description
A strong ID identifying a device.
Holders may safely assume that the underlying device is “alive” in the sense that the device is still recognized by the stack. That is, operations that use this device ID will never fail as a result of “unrecognized device”-like errors.
Variants§
Ethernet(BaseDeviceId<EthernetLinkDevice, BT>)
Loopback(BaseDeviceId<LoopbackDevice, BT>)
PureIp(BaseDeviceId<PureIpDevice, BT>)
Blackhole(BaseDeviceId<BlackholeDevice, BT>)
Implementations§
Source§impl<BT> DeviceId<BT>where
BT: DeviceLayerTypes,
impl<BT> DeviceId<BT>where
BT: DeviceLayerTypes,
Sourcepub fn downgrade(&self) -> WeakDeviceId<BT>
pub fn downgrade(&self) -> WeakDeviceId<BT>
Downgrade to a WeakDeviceId
.
Sourcepub fn bindings_id(&self) -> &<BT as DeviceLayerStateTypes>::DeviceIdentifier
pub fn bindings_id(&self) -> &<BT as DeviceLayerStateTypes>::DeviceIdentifier
Returns the bindings identifier associated with the device.
Trait Implementations§
Source§impl<BT> Clone for DeviceId<BT>where
BT: DeviceLayerTypes,
impl<BT> Clone for DeviceId<BT>where
BT: DeviceLayerTypes,
Source§impl<BT> Debug for DeviceId<BT>where
BT: DeviceLayerTypes,
impl<BT> Debug for DeviceId<BT>where
BT: DeviceLayerTypes,
Source§impl<BT> DeviceIdentifier for DeviceId<BT>where
BT: DeviceLayerTypes,
impl<BT> DeviceIdentifier for DeviceId<BT>where
BT: DeviceLayerTypes,
Source§fn is_loopback(&self) -> bool
fn is_loopback(&self) -> bool
Returns true if the device is a loopback device.
Source§impl<BT> DeviceWithName for DeviceId<BT>where
BT: DeviceLayerTypes,
impl<BT> DeviceWithName for DeviceId<BT>where
BT: DeviceLayerTypes,
Source§fn name_matches(&self, name: &str) -> bool
fn name_matches(&self, name: &str) -> bool
Returns whether the provided name matches the interface.
Source§impl<BT> From<BaseDeviceId<BlackholeDevice, BT>> for DeviceId<BT>where
BT: DeviceLayerTypes,
impl<BT> From<BaseDeviceId<BlackholeDevice, BT>> for DeviceId<BT>where
BT: DeviceLayerTypes,
Source§fn from(id: BaseDeviceId<BlackholeDevice, BT>) -> DeviceId<BT>
fn from(id: BaseDeviceId<BlackholeDevice, BT>) -> DeviceId<BT>
Converts to this type from the input type.
Source§impl<BT> From<BaseDeviceId<EthernetLinkDevice, BT>> for DeviceId<BT>where
BT: DeviceLayerTypes,
impl<BT> From<BaseDeviceId<EthernetLinkDevice, BT>> for DeviceId<BT>where
BT: DeviceLayerTypes,
Source§fn from(id: BaseDeviceId<EthernetLinkDevice, BT>) -> DeviceId<BT>
fn from(id: BaseDeviceId<EthernetLinkDevice, BT>) -> DeviceId<BT>
Converts to this type from the input type.
Source§impl<BT> From<BaseDeviceId<LoopbackDevice, BT>> for DeviceId<BT>where
BT: DeviceLayerTypes,
impl<BT> From<BaseDeviceId<LoopbackDevice, BT>> for DeviceId<BT>where
BT: DeviceLayerTypes,
Source§fn from(id: BaseDeviceId<LoopbackDevice, BT>) -> DeviceId<BT>
fn from(id: BaseDeviceId<LoopbackDevice, BT>) -> DeviceId<BT>
Converts to this type from the input type.
Source§impl<BT> From<BaseDeviceId<PureIpDevice, BT>> for DeviceId<BT>where
BT: DeviceLayerTypes,
impl<BT> From<BaseDeviceId<PureIpDevice, BT>> for DeviceId<BT>where
BT: DeviceLayerTypes,
Source§fn from(id: BaseDeviceId<PureIpDevice, BT>) -> DeviceId<BT>
fn from(id: BaseDeviceId<PureIpDevice, BT>) -> DeviceId<BT>
Converts to this type from the input type.
Source§impl<BT> Hash for DeviceId<BT>where
BT: DeviceLayerTypes,
impl<BT> Hash for DeviceId<BT>where
BT: DeviceLayerTypes,
Source§impl<BT> InterfaceProperties<<BT as FilterBindingsTypes>::DeviceClass> for DeviceId<BT>where
BT: DeviceLayerTypes,
impl<BT> InterfaceProperties<<BT as FilterBindingsTypes>::DeviceClass> for DeviceId<BT>where
BT: DeviceLayerTypes,
Source§fn id_matches(&self, id: &NonZero<u64>) -> bool
fn id_matches(&self, id: &NonZero<u64>) -> bool
Returns whether the provided ID matches the interface.
Source§fn device_class_matches(
&self,
device_class: &<BT as FilterBindingsTypes>::DeviceClass,
) -> bool
fn device_class_matches( &self, device_class: &<BT as FilterBindingsTypes>::DeviceClass, ) -> bool
Returns whether the provided device class matches the interface.
Source§impl<BT> Ord for DeviceId<BT>where
BT: DeviceLayerTypes,
impl<BT> Ord for DeviceId<BT>where
BT: DeviceLayerTypes,
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl<BT> PartialEq<DeviceId<BT>> for WeakDeviceId<BT>where
BT: DeviceLayerTypes,
impl<BT> PartialEq<DeviceId<BT>> for WeakDeviceId<BT>where
BT: DeviceLayerTypes,
Source§impl<BT> PartialEq<WeakDeviceId<BT>> for DeviceId<BT>where
BT: DeviceLayerTypes,
impl<BT> PartialEq<WeakDeviceId<BT>> for DeviceId<BT>where
BT: DeviceLayerTypes,
Source§impl<BT> PartialEq for DeviceId<BT>where
BT: DeviceLayerTypes,
impl<BT> PartialEq for DeviceId<BT>where
BT: DeviceLayerTypes,
Source§impl<BT> PartialOrd for DeviceId<BT>where
BT: DeviceLayerTypes,
impl<BT> PartialOrd for DeviceId<BT>where
BT: DeviceLayerTypes,
Source§impl<'a, BC: BindingsContext, L> ResourceCounterContext<DeviceId<BC>, DeviceCounters> for CoreCtx<'a, BC, L>
impl<'a, BC: BindingsContext, L> ResourceCounterContext<DeviceId<BC>, DeviceCounters> for CoreCtx<'a, BC, L>
Source§fn per_resource_counters<'b>(
&'b self,
device_id: &'b DeviceId<BC>,
) -> &'b DeviceCounters
fn per_resource_counters<'b>( &'b self, device_id: &'b DeviceId<BC>, ) -> &'b DeviceCounters
Returns a reference to the set of counters on
resource
.Source§impl<BT: BindingsTypes, L> ResourceCounterContext<DeviceId<BT>, IgmpCounters> for CoreCtx<'_, BT, L>
impl<BT: BindingsTypes, L> ResourceCounterContext<DeviceId<BT>, IgmpCounters> for CoreCtx<'_, BT, L>
Source§fn per_resource_counters<'a>(
&'a self,
device_id: &'a DeviceId<BT>,
) -> &'a IgmpCounters
fn per_resource_counters<'a>( &'a self, device_id: &'a DeviceId<BT>, ) -> &'a IgmpCounters
Returns a reference to the set of counters on
resource
.Source§impl<BT: BindingsTypes, L> ResourceCounterContext<DeviceId<BT>, MldCounters> for CoreCtx<'_, BT, L>
impl<BT: BindingsTypes, L> ResourceCounterContext<DeviceId<BT>, MldCounters> for CoreCtx<'_, BT, L>
Source§fn per_resource_counters<'a>(
&'a self,
device_id: &'a DeviceId<BT>,
) -> &'a MldCounters
fn per_resource_counters<'a>( &'a self, device_id: &'a DeviceId<BT>, ) -> &'a MldCounters
Returns a reference to the set of counters on
resource
.Source§impl<BT> StrongDeviceIdentifier for DeviceId<BT>where
BT: DeviceLayerTypes,
impl<BT> StrongDeviceIdentifier for DeviceId<BT>where
BT: DeviceLayerTypes,
Source§type Weak = WeakDeviceId<BT>
type Weak = WeakDeviceId<BT>
The weak version of this identifier.
impl<BT> Eq for DeviceId<BT>where
BT: DeviceLayerTypes,
Auto Trait Implementations§
impl<BT> Freeze for DeviceId<BT>
impl<BT> RefUnwindSafe for DeviceId<BT>where
<BT as DeviceLayerStateTypes>::EthernetDeviceState: RefUnwindSafe,
<BT as DeviceLayerStateTypes>::LoopbackDeviceState: RefUnwindSafe,
<BT as DeviceLayerStateTypes>::PureIpDeviceState: RefUnwindSafe,
<BT as DeviceLayerStateTypes>::BlackholeDeviceState: RefUnwindSafe,
<BT as DeviceLayerStateTypes>::DeviceIdentifier: RefUnwindSafe,
impl<BT> Send for DeviceId<BT>
impl<BT> Sync for DeviceId<BT>
impl<BT> Unpin for DeviceId<BT>
impl<BT> UnwindSafe for DeviceId<BT>where
<BT as DeviceLayerStateTypes>::EthernetDeviceState: RefUnwindSafe,
<BT as DeviceLayerStateTypes>::LoopbackDeviceState: RefUnwindSafe,
<BT as DeviceLayerStateTypes>::PureIpDeviceState: RefUnwindSafe,
<BT as DeviceLayerStateTypes>::BlackholeDeviceState: RefUnwindSafe,
<BT as DeviceLayerStateTypes>::DeviceIdentifier: RefUnwindSafe,
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<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§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>>where
S: Serializer,
<S as Serializer>::Buffer: BufferMut,
fn send_frame<S>(
&mut self,
bindings_ctx: &mut BC,
metadata: Meta,
frame: S,
) -> Result<(), ErrorAndSerializer<SendFrameErrorReason, S>>where
S: Serializer,
<S as Serializer>::Buffer: BufferMut,
Send a frame. Read more
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.