Struct ifcfg::IfCfg[][src]

pub struct IfCfg {
    pub name: String,
    pub mac: String,
    pub addresses: Vec<InterfaceAddress>,
    pub description: String,
}

Fields

name: Stringmac: Stringaddresses: Vec<InterfaceAddress>description: String

Implementations

impl IfCfg[src]

pub fn get() -> Result<Vec<IfCfg>>[src]

Gets the Interfaces from a computer

Example

use ifcfg::{IfCfg, Result};

fn main() -> Result<()> {
    let adapters = IfCfg::get().expect("could not get interfaces");
    println!("{}", serde_json::to_string(&adapters)?);
    Ok(())
}

Trait Implementations

impl Debug for IfCfg[src]

impl Serialize for IfCfg[src]

Auto Trait Implementations

impl RefUnwindSafe for IfCfg

impl Send for IfCfg

impl Sync for IfCfg

impl Unpin for IfCfg

impl UnwindSafe for IfCfg

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.