pub fn remove<T: Clone + Serialize + DeserializeOwned + 'static>(id: &Identifier) -> Result<()> {
    let mut guard = lock(&SINGLETONS);

    if let Some(instance) = guard.get(id) {
        if let Some(config) = instance.downcast_ref::<Configuration<T>>() {
            config.persist()?;
        } else {
            return Err(Error::InvalidArgument(format!(
                "wrong type specified for configuration {:?}",
                id
            )));
        }
    }

    match guard.remove(id) {
        Some(_) => Ok(()),
        None => {
            return Err(Error::InvalidArgument(format!(
                "unrecognized configuration identifier: {:?}",
                id
            )));
        }
    }
}
/// remove persists and then removes the configuration singleton matching the
/// given identifier. After calling this function, the configuration in question
/// will be unavailable.
remove persists and then removes the configuration singleton matching the
given identifier. After calling this function, the configuration in question
will be unavailable.
remove persists and then removes the configuration singleton matching the given identifier . After calling this function the configuration in question will be unavailable .
pub fn remove<T: Clone + Serialize + DeserializeOwned + 'static>(id: &Identifier) -> Result<()> {
    let mut guard = lock(&SINGLETONS);
    if let Some(instance) = guard.get(id) {
        if let Some(config) = instance.downcast_ref::<Configuration<T>>() {
            config.persist()?;
        } else {
            return Err(Error::InvalidArgument(format!(
                "wrong type specified for configuration {:?}",
                id
            )));
        }
    }
    match guard.remove(id) {
        Some(_) => Ok(()),
        None => {
            return Err(Error::InvalidArgument(format!(
                "unrecognized configuration identifier: {:?}",
                id
            )));
        }
    }
}
pub fn remove < T : Clone + Serialize + DeserializeOwned + ' static > ( id : & Identifier ) -> Result < ( ) > { let mut guard = lock ( & SINGLETONS ) ; if let Some ( instance ) = guard . get ( id ) { if let Some ( config ) = instance . downcast_ref :: < Configuration < T > > ( ) { config . persist ( ) ? ; } else { return Err ( Error :: InvalidArgument ( format ! ( " " id ) ) ) ; } } match guard . remove ( id ) { Some ( _ ) => Ok ( ( ) ) , None => { return Err ( Error :: InvalidArgument ( format ! ( " " id ) ) ) ; } } }
remove persists and then removes the configuration singleton matching the
given identifier.
remove persists and then removes the configuration singleton matching the given identifier .
id
&Identifier
id
&Identifier