Skip to main content

overrides

Macro overrides 

Source
overrides!() { /* proc-macro */ }
Expand description

Construct a typed OptionOverrideSet for a Mode::options() return.

Compile-time-typed: each entry is a path to an OptionDecl followed by = value. The macro emits a let-binding ascribed to <#decl as OptionDecl>::Value so values that don’t match the declaration’s Value type are compile errors. Optional #[priority(High)] / #[priority(Low)] attribute on an entry promotes it.

ⓘ
fn options(&self) -> OptionOverrideSet {
    lattice_config::overrides! {
        Tabstop = 4,
        IndentStyle = IndentStyle::Spaces,
        #[priority(High)]
        ReadOnly = true,
    }
}