pub fn remove_key<K: AbstractKey>(&mut self, key: &K) -> Result<bool> {
        if self.wrapped_keys.len() == 1 {
            if let Some(wrapped_key) = self.wrapped_keys.first() {
                if *wrapped_key.get_wrapping_digest() == key.get_digest() {
                    return Err(Error::Precondition(format!(
                        "refusing to remove all valid keys from this KeyStore"
                    )));
                }
            }
        }

        let original_length = self.wrapped_keys.len();
        let wrapped_keys = self
            .wrapped_keys
            .drain(..)
            .filter(|k| *k.get_wrapping_digest() != key.get_digest())
            .collect();
        self.wrapped_keys = wrapped_keys;
        Ok(original_length != self.wrapped_keys.len())
    }
/// Remove the given key from this KeyStore, so it can no longer be used to
/// open the KeyStore. Returns true if the key was removed, or false if the
/// given key wasn't found in this KeyStore. It is an error to remove the
/// last wrapping key from a KeyStore (doing so would leave it unopenable in
/// the future).
///
/// Note that it is possible to do this even if the KeyStore has no
/// unwrapped master key (e.g., even if it has not been opened).
Remove the given key from this KeyStore, so it can no longer be used to
open the KeyStore. Returns true if the key was removed, or false if the
given key wasn't found in this KeyStore. It is an error to remove the
last wrapping key from a KeyStore (doing so would leave it unopenable in
the future).

Note that it is possible to do this even if the KeyStore has no
unwrapped master key .
Remove the given key from this KeyStore so it can no longer be used to open the KeyStore . Returns true if the key was removed or false if the given key wasn ' t found in this KeyStore . It is an error to remove the last wrapping key from a KeyStore ( doing so would leave it unopenable in the future ) . Note that it is possible to do this even if the KeyStore has no unwrapped master key .
pub fn remove_key<K: AbstractKey>(&mut self, key: &K) -> Result<bool> {
        if self.wrapped_keys.len() == 1 {
            if let Some(wrapped_key) = self.wrapped_keys.first() {
                if *wrapped_key.get_wrapping_digest() == key.get_digest() {
                    return Err(Error::Precondition(format!(
                        "refusing to remove all valid keys from this KeyStore"
                    )));
                }
            }
        }
        let original_length = self.wrapped_keys.len();
        let wrapped_keys = self
            .wrapped_keys
            .drain(..)
            .filter(|k| *k.get_wrapping_digest() != key.get_digest())
            .collect();
        self.wrapped_keys = wrapped_keys;
        Ok(original_length != self.wrapped_keys.len())
    }
pub fn remove_key < K : AbstractKey > ( & mut self , key : & K ) -> Result < bool > { if self . wrapped_keys . len ( ) == 1 { if let Some ( wrapped_key ) = self . wrapped_keys . first ( ) { if * wrapped_key . get_wrapping_digest ( ) == key . get_digest ( ) { return Err ( Error :: Precondition ( format ! ( " " ) ) ) ; } } } let original_length = self . wrapped_keys . len ( ) ; let wrapped_keys = self . wrapped_keys . drain ( .. ) . filter ( | k | * k . get_wrapping_digest ( ) != key . get_digest ( ) ) . collect ( ) ; self . wrapped_keys = wrapped_keys ; Ok ( original_length != self . wrapped_keys . len ( ) ) }
Remove the given key from this KeyStore, so it can no longer be used to
open the KeyStore.
Remove the given key from this KeyStore so it can no longer be used to open the KeyStore .
&mut self
key
&K
&mut self
key
&K