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

Source§

Source

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.

Source

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.tomland 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.

Source

Returns worker_event_queue_size.

Panics if the cache is disabled.

Source

Returns baseline_compression_level.

Panics if the cache is disabled.

Source

Returns optimized_compression_level.

Panics if the cache is disabled.

Source

Returns optimized_compression_usage_counter_threshold.

Panics if the cache is disabled.

Source

Returns cleanup_interval.

Panics if the cache is disabled.

Source

Returns optimizing_compression_task_timeout.

Panics if the cache is disabled.

Source

Returns allowed_clock_drift_for_files_from_future.

Panics if the cache is disabled.

Source

Returns file_count_soft_limit.

Panics if the cache is disabled.

Source

Returns files_total_size_soft_limit.

Panics if the cache is disabled.

Source

Returns file_count_limit_percent_if_deleting.

Panics if the cache is disabled.

Source

Returns files_total_size_limit_percent_if_deleting.

Panics if the cache is disabled.

Source

Returns path to the cache directory.

Panics if the cache directory is not set.

Source

Returns the number of cache hits seen so far

Source

Returns the number of cache misses seen so far

§

§

§

§

§

§