Struct Interface
pub struct Interface { /* private fields */ }net only.Expand description
A network interface of the local host, as enumerated by interfaces.
Implementations§
§impl Interface
impl Interface
pub fn name(&self) -> &str
pub fn name(&self) -> &str
OS name of the interface: the kernel name on unix platforms (eth0,
en0), the adapter’s friendly name on windows (Ethernet 1).
pub fn index(&self) -> Option<u32>
pub fn index(&self) -> Option<u32>
OS interface index, when known.
On windows this is the IPv4 interface index, falling back to the IPv6
one — the two are distinct numbering spaces there. For the zone of a
scoped IPv6 address use InterfaceAddress::scope_id instead.
pub fn flags(&self) -> InterfaceFlags
pub fn flags(&self) -> InterfaceFlags
Status and capability flags of this interface.
pub fn hardware_address(&self) -> Option<&HardwareAddress>
pub fn hardware_address(&self) -> Option<&HardwareAddress>
Link-layer (MAC) address, when one is reported.
pub fn description(&self) -> Option<&str>
pub fn description(&self) -> Option<&str>
Human-readable adapter description. Only reported on windows.
pub fn addresses(&self) -> &[InterfaceAddress]
pub fn addresses(&self) -> &[InterfaceAddress]
The IP addresses assigned to this interface, in OS order.
pub fn device_name(&self) -> Option<DeviceName>
Available on Android or Fuchsia or Linux only.
pub fn device_name(&self) -> Option<DeviceName>
This interface’s name as a DeviceName, usable with
SocketOptions::device to bind a socket to it.
None when the kernel name does not pass DeviceName validation.
Trait Implementations§
Auto Trait Implementations§
impl Forget for Interface
impl Freeze for Interfacewhere
&'static str: Freeze,
*const ArcInner<str> is !null: Freeze,
PhantomData<ArcInner<str>>: Freeze,
InternalBitFlags: Freeze,
*const u8 is !null: Freeze,
PhantomData<InterfaceAddress>: Freeze,
impl Move for Interface
impl RefUnwindSafe for Interface
impl Send for Interface
impl Sync for Interface
impl Unpin for Interface
impl UnsafeUnpin for Interfacewhere
&'static str: UnsafeUnpin,
*const ArcInner<str> is !null: UnsafeUnpin,
PhantomData<ArcInner<str>>: UnsafeUnpin,
InternalBitFlags: UnsafeUnpin,
*const u8 is !null: UnsafeUnpin,
PhantomData<InterfaceAddress>: UnsafeUnpin,
impl UnwindSafe for Interfacewhere
&'static str: UnwindSafe,
Arc<str>: UnwindSafe,
InternalBitFlags: UnwindSafe,
RawVecInner: UnwindSafe,
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
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,
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
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> ⓘ
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> ⓘ
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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a rama_grpc::Request§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
§fn and<P, B, E>(self, other: P) -> And<T, P>
fn and<P, B, E>(self, other: P) -> And<T, P>
Policy that returns Action::Follow only if self and other return
Action::Follow. Read more