Enum netstack3_core::device::DeviceId
source · pub enum DeviceId<C: DeviceLayerTypes> {
Ethernet(EthernetDeviceId<C>),
Loopback(LoopbackDeviceId<C>),
}
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(EthernetDeviceId<C>)
Loopback(LoopbackDeviceId<C>)
Implementations§
source§impl<C: DeviceLayerTypes> DeviceId<C>
impl<C: DeviceLayerTypes> DeviceId<C>
sourcepub fn downgrade(&self) -> WeakDeviceId<C>
pub fn downgrade(&self) -> WeakDeviceId<C>
Downgrade to a WeakDeviceId
.
Trait Implementations§
source§impl<C: DeviceLayerTypes> Clone for DeviceId<C>
impl<C: DeviceLayerTypes> Clone for DeviceId<C>
source§impl<C: DeviceLayerTypes> Debug for DeviceId<C>
impl<C: DeviceLayerTypes> Debug for DeviceId<C>
source§impl<C: DeviceLayerTypes> Display for DeviceId<C>
impl<C: DeviceLayerTypes> Display for DeviceId<C>
source§impl<C: DeviceLayerTypes> From<EthernetDeviceId<C>> for DeviceId<C>
impl<C: DeviceLayerTypes> From<EthernetDeviceId<C>> for DeviceId<C>
source§fn from(id: EthernetDeviceId<C>) -> DeviceId<C>
fn from(id: EthernetDeviceId<C>) -> DeviceId<C>
Converts to this type from the input type.
source§impl<C: DeviceLayerTypes> From<LoopbackDeviceId<C>> for DeviceId<C>
impl<C: DeviceLayerTypes> From<LoopbackDeviceId<C>> for DeviceId<C>
source§fn from(id: LoopbackDeviceId<C>) -> DeviceId<C>
fn from(id: LoopbackDeviceId<C>) -> DeviceId<C>
Converts to this type from the input type.
source§impl<C: DeviceLayerTypes> Hash for DeviceId<C>
impl<C: DeviceLayerTypes> Hash for DeviceId<C>
source§impl<C: DeviceLayerTypes> IdMapCollectionKey for DeviceId<C>
impl<C: DeviceLayerTypes> IdMapCollectionKey for DeviceId<C>
source§const VARIANT_COUNT: NonZeroUsize = _
const VARIANT_COUNT: NonZeroUsize = _
The number of variants this key supports.
source§fn get_variant(&self) -> usize
fn get_variant(&self) -> usize
Get the variant index for this key. Read more
source§impl<C: DeviceLayerTypes> PartialEq<DeviceId<C>> for DeviceId<C>
impl<C: DeviceLayerTypes> PartialEq<DeviceId<C>> for DeviceId<C>
source§impl<C: DeviceLayerTypes> PartialEq<DeviceId<C>> for WeakDeviceId<C>
impl<C: DeviceLayerTypes> PartialEq<DeviceId<C>> for WeakDeviceId<C>
source§impl<C: DeviceLayerTypes> PartialEq<WeakDeviceId<C>> for DeviceId<C>
impl<C: DeviceLayerTypes> PartialEq<WeakDeviceId<C>> for DeviceId<C>
source§fn eq(&self, other: &WeakDeviceId<C>) -> bool
fn eq(&self, other: &WeakDeviceId<C>) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl<C: DeviceLayerTypes> Eq for DeviceId<C>
Auto Trait Implementations§
impl<C> RefUnwindSafe for DeviceId<C>where <C as DeviceLayerStateTypes>::EthernetDeviceState: RefUnwindSafe, <C as DeviceLayerStateTypes>::LoopbackDeviceState: RefUnwindSafe,
impl<C> Send for DeviceId<C>
impl<C> Sync for DeviceId<C>
impl<C> Unpin for DeviceId<C>
impl<C> UnwindSafe for DeviceId<C>where <C as DeviceLayerStateTypes>::EthernetDeviceState: RefUnwindSafe, <C as DeviceLayerStateTypes>::LoopbackDeviceState: 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<O> EntryKey for Owhere
O: IdMapCollectionKey,
impl<O> EntryKey for Owhere O: IdMapCollectionKey,
source§fn get_key_index(&self) -> usize
fn get_key_index(&self) -> usize
Returns the index for this key.