pub fn add_interface<N>(mut self, name: N, iface: Interface) -> Result<Self>
        where N: ToString,
    {
        {
            let mut map = self.map.borrow_mut();

            match map.entry(name.to_string()) {
                Entry::Vacant(v) => {
                    v.insert(iface);

                    Ok(())
                },
                Entry::Occupied(_) => bail!(ErrorKind::InterfaceAlreadyRegistered(name.to_string())),
            }
        }
        .map(|_| self)
    }
/// Add an interface to the set.
Add an interface to the set.
Add an interface to the set .
pub fn add_interface<N>(mut self, name: N, iface: Interface) -> Result<Self>
        where N: ToString,
    {
        {
            let mut map = self.map.borrow_mut();
            match map.entry(name.to_string()) {
                Entry::Vacant(v) => {
                    v.insert(iface);
                    Ok(())
                },
                Entry::Occupied(_) => bail!(ErrorKind::InterfaceAlreadyRegistered(name.to_string())),
            }
        }
        .map(|_| self)
    }
pub fn add_interface < N > ( mut self , name : N , iface : Interface ) -> Result < Self > where N : ToString , { { let mut map = self . map . borrow_mut ( ) ; match map . entry ( name . to_string ( ) ) { Entry :: Vacant ( v ) => { v . insert ( iface ) ; Ok ( ( ) ) } , Entry :: Occupied ( _ ) => bail ! ( ErrorKind InterfaceAlreadyRegistered ( name to_string ( ) ) ) , } } . map ( | _ | self ) }
Add an interface to the set.
Add an interface to the set .
mut self
name
N
iface
Interface