MCPcopy Create free account
hub / github.com/bytecodealliance/wasmtime / new

Method new

crates/cache/src/lib.rs:54–61  ·  view source on GitHub ↗

Builds a [`Cache`] from the configuration and spawns the cache worker. If you want to load the cache configuration from a file, use [`CacheConfig::from_file`]. You can call [`CacheConfig::new`] for the default configuration. # Errors Returns an error if the configuration is invalid.

(mut config: CacheConfig)

Source from the content-addressed store, hash-verified

52 /// # Errors
53 /// Returns an error if the configuration is invalid.
54 pub fn new(mut config: CacheConfig) -> Result<Self> {
55 config.validate()?;
56 Ok(Self {
57 worker: Worker::start_new(&config),
58 config,
59 state: Default::default(),
60 })
61 }
62
63 /// Loads cache configuration specified at `path`.
64 ///

Callers

nothing calls this directly

Calls 7

OkFunction · 0.85
newFunction · 0.50
validateMethod · 0.45
mapMethod · 0.45
to_stringMethod · 0.45
joinMethod · 0.45
directoryMethod · 0.45

Tested by

no test coverage detected