pub struct InterfaceName { /* private fields */ }Expand description
The name of a network interface.
Implementations§
Source§impl InterfaceName
impl InterfaceName
Sourcepub fn as_cstr(&self) -> &CStr
pub fn as_cstr(&self) -> &CStr
The name of the interface as a c string.
§Panics
May panic if the interface name is invalid and not terminated with a null byte.
Sourcepub fn to_ifr_name(self) -> [c_char; 16]
pub fn to_ifr_name(self) -> [c_char; 16]
Conversion to a type for the ifr_name field.
Sourcepub fn from_socket_addr(local_addr: SocketAddr) -> Result<Option<Self>>
pub fn from_socket_addr(local_addr: SocketAddr) -> Result<Option<Self>>
Find the interface name for a given local address of a socket.
§Errors
May fail if the address is not associated with any local interface.
Sourcepub fn get_index(&self) -> Option<c_uint>
pub fn get_index(&self) -> Option<c_uint>
The index of the socket used by the operating system.
Sourcepub fn lookup_phc(&self) -> Option<u32>
pub fn lookup_phc(&self) -> Option<u32>
Do a lookup for the Physical Hardware Clock index for this interface.
Trait Implementations§
Source§impl Clone for InterfaceName
impl Clone for InterfaceName
impl Copy for InterfaceName
Source§impl Debug for InterfaceName
impl Debug for InterfaceName
Source§impl<'de> Deserialize<'de> for InterfaceName
Available on crate feature serde only.
impl<'de> Deserialize<'de> for InterfaceName
Available on crate feature
serde only.Source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for InterfaceName
impl Display for InterfaceName
impl Eq for InterfaceName
Source§impl FromStr for InterfaceName
impl FromStr for InterfaceName
Source§impl Hash for InterfaceName
impl Hash for InterfaceName
Source§impl PartialEq for InterfaceName
impl PartialEq for InterfaceName
impl StructuralPartialEq for InterfaceName
Auto Trait Implementations§
impl Forget for InterfaceName
impl Freeze for InterfaceName
impl Move for InterfaceName
impl RefUnwindSafe for InterfaceName
impl Send for InterfaceName
impl Sync for InterfaceName
impl Unpin for InterfaceName
impl UnsafeUnpin for InterfaceName
impl UnwindSafe for InterfaceName
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