pub struct Config {
pub daemon: DaemonConfig,
pub admission: AdmissionConfig,
pub benchmark: BenchmarkConfig,
pub leases: LeaseConfig,
pub retention: RetentionConfig,
pub hook: HookConfig,
pub classes: ClassProfiles,
pub presets: Presets,
pub classifier: ClassifierConfig,
pub linux: LinuxConfig,
}Expand description
Daemon configuration, read from config.toml.
Every value has a default, so a user file only lists what it changes. Tables merge field
by field over the defaults; arrays such as classifier.rules replace the default list as
a whole. Unknown keys are rejected so that typos surface instead of being ignored.
Fields§
§daemon: DaemonConfigHTTP listener settings.
admission: AdmissionConfigHow much of the machine the admission engine keeps free.
benchmark: BenchmarkConfigWhen the machine counts as quiet enough for a benchmark.
leases: LeaseConfigLease lifetime settings.
retention: RetentionConfigHow long ended leases and job history are kept.
hook: HookConfigPreToolUse hook behavior.
classes: ClassProfilesThe profile behind each JobClass.
presets: PresetsNamed profiles sized between the classes, chosen by name like a class.
classifier: ClassifierConfigWhich shell commands count as heavy.
linux: LinuxConfigHow leases use cgroups on Linux; ignored on other OSes.
Implementations§
Source§impl Config
impl Config
Sourcepub fn from_toml(text: &str) -> Result<Self>
pub fn from_toml(text: &str) -> Result<Self>
Parses and validates a TOML document. Missing values take their defaults.
§Errors
Returns Error::ConfigParse for malformed TOML, unknown keys, or wrongly typed
values, and Error::Config for values out of range.
Sourcepub fn load(path: &Path) -> Result<Self>
pub fn load(path: &Path) -> Result<Self>
Loads the file at path, or the defaults when the file does not exist.
§Errors
Returns Error::ConfigFile naming path when the file exists but cannot be read,
or holds what Config::from_toml rejects.