pub fn interface(name: Option<String>) -> Option<Interface> {
    let mut inters = match name {
        Some(ref name) => {
            let mut inters = interfaces();
            inters.retain(|ref inter| inter.name() == name);

            inters
        }
        None => interfaces(),
    };

    if inters.len() != 1 {
        None
    } else {
        Some(inters.pop().unwrap())
    }
}
/// Gets an available network interface.
Gets an available network interface.
Gets an available network interface .
pub fn interface(name: Option<String>) -> Option<Interface> {
    let mut inters = match name {
        Some(ref name) => {
            let mut inters = interfaces();
            inters.retain(|ref inter| inter.name() == name);
            inters
        }
        None => interfaces(),
    };
    if inters.len() != 1 {
        None
    } else {
        Some(inters.pop().unwrap())
    }
}
pub fn interface ( name : Option < String > ) -> Option < Interface > { let mut inters = match name { Some ( ref name ) => { let mut inters = interfaces ( ) ; inters . retain ( | ref inter | inter . name ( ) == name ) ; inters } None => interfaces ( ) , } ; if inters . len ( ) != 1 { None } else { Some ( inters . pop ( ) . unwrap ( ) ) } }
Gets an available network interface.
Gets an available network interface .
name
Option<String>
name
Option<String>