Skip to main content

Module option

Module option 

Source
Expand description

Typed Option<T> spec + the OptionHandle<T> consumers use for hot-path reads.

Each option owns its current value behind an [ArcSwap<T>]. Reads are wait-free pointer loads; writes go through Option::set (or, more commonly, via the registry’s parse_and_set driven by :set foo=value).

Structs§

Option
A typed config option. The user-visible name + metadata, plus the cell holding the current value. Constructed once and handed to crate::ConfigRegistry::register, which returns a typed OptionHandle consumers use to read / write.
OptionBuilder
Fluent constructor for Option<T>. See Option::builder.
OptionHandle
Typed pointer into the registry. Returned by crate::ConfigRegistry::register; passed back to crate::ConfigRegistry::get / crate::ConfigRegistry::set for type-safe access without string lookups.

Type Aliases§

ValidateFn
Post-parse validator. Runs after OptionType::parse succeeds and before commit; returning Err(_) cancels the set with that message.