Cache in wasmtime - Rust (original) (raw)
pub struct Cache { /* private fields */ }
Available on crate feature cache
only.
Expand description
Global configuration for how the cache is managed
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.
Loads cache configuration specified at path
.
This method will read the file specified by path
on the filesystem and attempt to load cache configuration from it. This method can also fail due to I/O errors, misconfiguration, syntax errors, etc. For expected syntax in the configuration file see the documentation online.
Passing in None
loads cache configuration from the system default path. This is located, for example, on Unix at $HOME/.config/wasmtime/config.toml
and is typically created with the wasmtime config new
command.
§Errors
This method can fail due to any error that happens when loading the file pointed to by path
and attempting to load the cache configuration.
Returns worker_event_queue_size
.
Panics if the cache is disabled.
Returns baseline_compression_level
.
Panics if the cache is disabled.
Returns optimized_compression_level
.
Panics if the cache is disabled.
Returns optimized_compression_usage_counter_threshold
.
Panics if the cache is disabled.
Returns cleanup_interval
.
Panics if the cache is disabled.
Returns optimizing_compression_task_timeout
.
Panics if the cache is disabled.
Returns allowed_clock_drift_for_files_from_future
.
Panics if the cache is disabled.
Returns file_count_soft_limit
.
Panics if the cache is disabled.
Returns files_total_size_soft_limit
.
Panics if the cache is disabled.
Returns file_count_limit_percent_if_deleting
.
Panics if the cache is disabled.
Returns files_total_size_limit_percent_if_deleting
.
Panics if the cache is disabled.
Returns path to the cache directory.
Panics if the cache directory is not set.
Returns the number of cache hits seen so far
Returns the number of cache misses seen so far