You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: secrets_store.rs
    path of file: ./repos/freenet-core/crates/core/src/wasm_runtime
    
    the code of the file until where you have to start completion: use std::{
    collections::{HashMap, HashSet},
    fs::{self, File},
    io::Write,
    path::PathBuf,
    sync::Arc,
};

use blake3::traits::digest::generic_array::GenericArray;
use chacha20poly1305::{aead::Aead, Error as EncryptionError, KeyInit, XChaCha20Poly1305, XNonce};
use dashmap::DashMap;
use freenet_stdlib::{client_api::DelegateReques
    
    pub fn new(secrets_dir: PathBuf) -> RuntimeResult<Self> {
        let mut key_to_secret_part = Arc::new(DashMap::new());
        let key_file = secrets_dir.join("KEY_DATA");
        if !key_file.exists() {
            std::fs::create_dir_all(&secrets_dir).map_err(|err| {
                tracing::error!("error creating delegate dir: {err}");
                err
            })?;
            File::create(secrets_dir.join("KEY_DATA"))?;
        } else {
            Self::load_from_file(&key_file, &mut key_to_secret_part)?;
        }
        Self::watch_changes(key_to_secret_part.clone(), &key_file)?;

        let index_file = SafeWriter::new(&key_file, false)?;
        Ok(Self {
            base_path: secrets_dir,
            ciphers: HashMap::new(),
            key_to_secret_part,
            index_file,
            key_file,
        })
    }