pub fn interface(name: Option<String>) -> Option<Interface> {
    let inters = match name {
        Some(name) => {
            let mut inters = interfaces();
            inters.retain(|current_inter| current_inter.name == name);
            inters
        }
        None => auto_interfaces(),
    };

    if inters.len() != 1 {
        None
    } else {
        Some(inters[0].clone())
    }
}
/// Gets an available network interface match the name.
Gets an available network interface match the name.
Gets an available network interface match the name .
pub fn interface(name: Option<String>) -> Option<Interface> {
    let inters = match name {
        Some(name) => {
            let mut inters = interfaces();
            inters.retain(|current_inter| current_inter.name == name);
            inters
        }
        None => auto_interfaces(),
    };
    if inters.len() != 1 {
        None
    } else {
        Some(inters[0].clone())
    }
}
pub fn interface ( name : Option < String > ) -> Option < Interface > { let inters = match name { Some ( name ) => { let mut inters = interfaces ( ) ; inters . retain ( | current_inter | current_inter . name == name ) ; inters } None => auto_interfaces ( ) , } ; if inters . len ( ) != 1 { None } else { Some ( inters [ 0 ] . clone ( ) ) } }
Gets an available network interface match the name.
Gets an available network interface match the name .
name
Option<String>