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

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

Formats the value using the given formatter. Read more

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.