fn secret_destroy(&mut self, context: Box<dyn Secret>) -> OckamResult<()> {
        let id = FilesystemVaultSecret::downcast_secret(&context)?.0;

        let path = self.path.join(id_to_path(id));
        match fs::metadata(path.clone()) {
            Ok(md) if md.is_file() => {
                fs::remove_file(path).map_err(|_| Error::IOError.into())?;
            }
            _ => {}
        }

        let context = FilesystemVaultSecret::downcast_secret(&context)?;
        let context = self
            .map
            .remove(&context.0)
            .ok_or(Error::EntryNotFound.into())?;
        self.v.secret_destroy(context)?;

        Ok(())
    }
/// Remove a secret key from the vault
Remove a secret key from the vault
Remove a secret key from the vault
fn secret_destroy(&mut self, context: Box<dyn Secret>) -> OckamResult<()> {
        let id = FilesystemVaultSecret::downcast_secret(&context)?.0;
        let path = self.path.join(id_to_path(id));
        match fs::metadata(path.clone()) {
            Ok(md) if md.is_file() => {
                fs::remove_file(path).map_err(|_| Error::IOError.into())?;
            }
            _ => {}
        }
        let context = FilesystemVaultSecret::downcast_secret(&context)?;
        let context = self
            .map
            .remove(&context.0)
            .ok_or(Error::EntryNotFound.into())?;
        self.v.secret_destroy(context)?;
        Ok(())
    }
fn secret_destroy ( & mut self , context : Box < dyn Secret > ) -> OckamResult < ( ) > { let id = FilesystemVaultSecret :: downcast_secret ( & context ) ? . 0 ; let path = self . path . join ( id_to_path ( id ) ) ; match fs :: metadata ( path . clone ( ) ) { Ok ( md ) if md . is_file ( ) => { fs :: remove_file ( path ) . map_err ( | _ | Error :: IOError . into ( ) ) ? ; } _ => { } } let context = FilesystemVaultSecret :: downcast_secret ( & context ) ? ; let context = self . map . remove ( & context . 0 ) . ok_or ( Error :: EntryNotFound . into ( ) ) ? ; self . v . secret_destroy ( context ) ? ; Ok ( ( ) ) }
Remove a secret key from the vault
Remove a secret key from the vault
&mut self
context
Box<dyn Secret>
&mut self
context
Box<dyn Secret>