pub unsafe fn new<P: Into<PathBuf>>(
        base_dir: P,
        supported_features: HashSet<String>,
    ) -> VmResult<Self> {
        let base = base_dir.into();
        let wasm_path = base.join(WASM_DIR);
        create_dir_all(&wasm_path)
            .map_err(|e| VmError::cache_err(format!("Error creating Wasm dir for cache: {}", e)))?;

        let modules = FileSystemCache::new(base.join(MODULES_DIR))
            .map_err(|e| VmError::cache_err(format!("Error file system cache: {}", e)))?;
        Ok(CosmCache {
            wasm_path,
            supported_features,
            modules,
            stats: Stats::default(),
            type_storage: PhantomData::<S>,
            type_api: PhantomData::<A>,
            type_querier: PhantomData::<Q>,
        })
    }
/// new stores the data for cache under base_dir
///
/// Instance caching is disabled since 0.8.1 and any cache size value will be treated as 0.
///
/// # Safety
///
/// This function is marked unsafe due to `FileSystemCache::new`, which implicitly
/// assumes the disk contents are correct, and there's no way to ensure the artifacts
//  stored in the cache haven't been corrupted or tampered with.
new stores the data for cache under base_dir
Instance caching is disabled since 0.8.1 and any cache size value will be treated as 0.
new stores the data for cache under base_dir Instance caching is disabled since 0 . 8 . 1 and any cache size value will be treated as 0 .
pub unsafe fn new<P: Into<PathBuf>>(
        base_dir: P,
        supported_features: HashSet<String>,
    ) -> VmResult<Self> {
        let base = base_dir.into();
        let wasm_path = base.join(WASM_DIR);
        create_dir_all(&wasm_path)
            .map_err(|e| VmError::cache_err(format!("Error creating Wasm dir for cache: {}", e)))?;
        let modules = FileSystemCache::new(base.join(MODULES_DIR))
            .map_err(|e| VmError::cache_err(format!("Error file system cache: {}", e)))?;
        Ok(CosmCache {
            wasm_path,
            supported_features,
            modules,
            stats: Stats::default(),
            type_storage: PhantomData::<S>,
            type_api: PhantomData::<A>,
            type_querier: PhantomData::<Q>,
        })
    }
pub unsafe fn new < P : Into < PathBuf > > ( base_dir : P , supported_features : HashSet < String > , ) -> VmResult < Self > { let base = base_dir . into ( ) ; let wasm_path = base . join ( WASM_DIR ) ; create_dir_all ( & wasm_path ) . map_err ( | e | VmError :: cache_err ( format ! ( " " e ) ) ) ? ; let modules = FileSystemCache :: new ( base . join ( MODULES_DIR ) ) . map_err ( | e | VmError :: cache_err ( format ! ( " " e ) ) ) ? ; Ok ( CosmCache { wasm_path , supported_features , modules , stats : Stats :: default ( ) , type_storage : PhantomData :: < S > , type_api : PhantomData :: < A > , type_querier : PhantomData :: < Q > , } ) }
new stores the data for cache under base_dir
Instance caching is disabled since 0.8.1 and any cache size value will be treated as 0.
new stores the data for cache under base_dir Instance caching is disabled since 0 . 8 . 1 and any cache size value will be treated as 0 .
base_dir
P
supported_features
HashSet<String>
base_dir
P
supported_features
HashSet<String>
safety
This function is marked unsafe due to `FileSystemCache::new`, which implicitly
assumes the disk contents are correct, and there's no way to ensure the artifacts
stored in the cache haven't been corrupted or tampered with.
This function is marked unsafe due to ` FileSystemCache :: new ` which implicitly assumes the disk contents are correct and there ' s no way to ensure the artifacts stored in the cache haven ' t been corrupted or tampered with .