pub struct Config {Show 16 fields
pub threads: Setting<Count>,
pub memory_max: Setting<Amount>,
pub memory_ceiling: Setting<Amount>,
pub memory_split: Setting<bool>,
pub cache_enabled: Setting<bool>,
pub cache_dir: Setting<CacheDir>,
pub cache_max: Setting<Amount>,
pub cache_ceiling: Setting<Bytes>,
pub cache_tiers: Setting<Tiers>,
pub cache_min_dex: Setting<Bytes>,
pub cache_write_queue: Setting<Bytes>,
pub cache_writers: Setting<Count>,
pub cache_spill: Setting<Bytes>,
pub daemon_idle: Setting<Seconds>,
pub daemon_wait: Setting<Millis>,
pub file: Option<PathBuf>,
}Expand description
The resolved settings (Config::resolve).
Fields§
§threads: Setting<Count>§memory_max: Setting<Amount>§memory_ceiling: Setting<Amount>§memory_split: Setting<bool>§cache_enabled: Setting<bool>§cache_dir: Setting<CacheDir>§cache_max: Setting<Amount>§cache_ceiling: Setting<Bytes>§cache_tiers: Setting<Tiers>§cache_min_dex: Setting<Bytes>§cache_write_queue: Setting<Bytes>§cache_writers: Setting<Count>§cache_spill: Setting<Bytes>§daemon_idle: Setting<Seconds>§daemon_wait: Setting<Millis>§file: Option<PathBuf>The config file read, if any.
Implementations§
Source§impl Config
impl Config
Sourcepub fn file_path(env: impl Fn(&str) -> Option<String>) -> Option<PathBuf>
pub fn file_path(env: impl Fn(&str) -> Option<String>) -> Option<PathBuf>
The config file: $ASC_CONFIG (empty: none), else
$XDG_CONFIG_HOME/asc/config.toml, else
~/.config/asc/config.toml.
Sourcepub fn load(flags: &[(String, String)]) -> Result<Config, ConfigError>
pub fn load(flags: &[(String, String)]) -> Result<Config, ConfigError>
Read the process’s environment and config file, then apply flags
((key, value) pairs from the command line).
Sourcepub fn resolve(
file: Option<(&Path, &str)>,
env: impl Fn(&str) -> Option<String>,
flags: &[(String, String)],
) -> Result<Config, ConfigError>
pub fn resolve( file: Option<(&Path, &str)>, env: impl Fn(&str) -> Option<String>, flags: &[(String, String)], ) -> Result<Config, ConfigError>
Defaults, then the file (path, text), then env, then flags.
Sourcepub fn flag_pairs(&self) -> Vec<(String, String)>
pub fn flag_pairs(&self) -> Vec<(String, String)>
The (key, value) pairs of the settings given on the command line,
to hand on to a process started for this one (a daemon).
pub fn threads(&self) -> Threads
Sourcepub fn fixed_threads(&self) -> Option<usize>
pub fn fixed_threads(&self) -> Option<usize>
Config::threads as an explicit count, None for auto.
Sourcepub fn memory_policy(&self, device: &Device) -> Option<MemoryPolicy>
pub fn memory_policy(&self, device: &Device) -> Option<MemoryPolicy>
How an automatic memory cache follows device; None for a fixed size.
Sourcepub fn memory_bytes(&self, device: &Device) -> usize
pub fn memory_bytes(&self, device: &Device) -> usize
The memory cache’s starting size on device.
Sourcepub fn cache_dir(&self) -> Option<PathBuf>
pub fn cache_dir(&self) -> Option<PathBuf>
The cache directory in use (None: the cache is off, or no default
directory could be determined).
pub fn disk_capacity(&self) -> DiskCapacity
Sourcepub fn disk_cache(&self) -> Option<DiskCache>
pub fn disk_cache(&self) -> Option<DiskCache>
The disk cache, unless it is off.
Sourcepub fn one_shot_cache(&self) -> CacheConfig
pub fn one_shot_cache(&self) -> CacheConfig
The cache of a one-shot command: the disk cache only.
Sourcepub fn resident_cache(&self, device: &Device) -> CacheConfig
pub fn resident_cache(&self, device: &Device) -> CacheConfig
The cache of a resident host (mcp, the daemon) on device.