pub struct InterfaceId(/* private fields */);Expand description
Stable network interface identifier.
The numeric value is also used as the Linux ifindex exposed by StarryOS.
Implementations§
Source§impl InterfaceId
impl InterfaceId
pub const LOOPBACK: Self
pub const fn new(raw: u32) -> Self
pub const fn get(self) -> u32
Sourcepub const fn to_linux_ifindex(self) -> i32
pub const fn to_linux_ifindex(self) -> i32
Convert to Linux ifindex (i32).
Sourcepub const fn from_linux_ifindex(ifindex: i32) -> Option<Self>
pub const fn from_linux_ifindex(ifindex: i32) -> Option<Self>
Create from Linux ifindex (i32), rejecting invalid values.
Trait Implementations§
Source§impl Clone for InterfaceId
impl Clone for InterfaceId
Source§fn clone(&self) -> InterfaceId
fn clone(&self) -> InterfaceId
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for InterfaceId
Source§impl Debug for InterfaceId
impl Debug for InterfaceId
impl Eq for InterfaceId
Source§impl Hash for InterfaceId
impl Hash for InterfaceId
Source§impl Ord for InterfaceId
impl Ord for InterfaceId
Source§fn cmp(&self, other: &InterfaceId) -> Ordering
fn cmp(&self, other: &InterfaceId) -> Ordering
1.21.0 (const: unstable) · 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
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Source§impl PartialEq for InterfaceId
impl PartialEq for InterfaceId
Source§impl PartialOrd for InterfaceId
impl PartialOrd for InterfaceId
impl StructuralPartialEq for InterfaceId
Auto Trait Implementations§
impl Freeze for InterfaceId
impl RefUnwindSafe for InterfaceId
impl Send for InterfaceId
impl Sync for InterfaceId
impl Unpin for InterfaceId
impl UnsafeUnpin for InterfaceId
impl UnwindSafe for InterfaceId
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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
impl<T> DmaPod for Twhere
T: Copy,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.