pub struct Builder { /* private fields */ }
Expand description

Collect settings values based on a template.

Implementations§

Create a new builder with defaults and names from the given template.

Examples found in repository?
/opt/rustwide/target/i686-unknown-linux-gnu/debug/build/cranelift-codegen-602ee289750c70df/out/settings.rs (line 820)
819
820
821
pub fn builder() -> Builder {
    Builder::new(&TEMPLATE)
}

Extract contents of builder once everything is configured.

Examples found in repository?
/opt/rustwide/target/i686-unknown-linux-gnu/debug/build/cranelift-codegen-602ee289750c70df/out/settings.rs (line 10)
9
10
11
12
13
14
15
    pub fn new(builder: Builder) -> Self {
        let bvec = builder.state_for("shared");
        let mut shared = Self { bytes: [0; 9] };
        debug_assert_eq!(bvec.len(), 9);
        shared.bytes[0..9].copy_from_slice(&bvec);
        shared
    }

Iterates the available settings in the builder.

Examples found in repository?
src/isa/mod.rs (line 158)
157
158
159
    pub fn iter(&self) -> impl Iterator<Item = settings::Setting> {
        self.setup.iter()
    }

Trait Implementations§

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Enable a boolean setting or apply a preset. Read more
Set the string value of any setting by name. Read more
Feeds this value into the given Hasher. Read more
Feeds a slice of this type into the given Hasher. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.