pub struct Configuration {
    pub temperature_oversampling: Option<Oversampling>,
    pub pressure_oversampling: Option<Oversampling>,
    pub humidity_oversampling: Option<Oversampling>,
    pub filter: Option<IIRFilter>,
    pub gas_config: Option<GasConfig>,
}
Expand description

Used to set Sensor settings. All options not set by the builder are set to default values.

let configuration = Configuration::builder()
                    .temperature_oversampling(Oversampling::By2)
                    .pressure_oversampling(Oversampling::By16)
                    .humidity_oversampling(Oversampling::By1)
                    .filter(IIRFilter::Coeff1)
                    // Gas measurment is enabled by default. To disable it pass None as the GasConfig
                    .gas_config(None)
                    .build();
                         

Fields§

§temperature_oversampling: Option<Oversampling>§pressure_oversampling: Option<Oversampling>§humidity_oversampling: Option<Oversampling>§filter: Option<IIRFilter>§gas_config: Option<GasConfig>

Implementations§

Trait Implementations§

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more

Sets sensible default values for all options. Temperature oversampling: By2, Pressure oversampling: By16, Humidity oversampling: By1, IIRFilter: Coeff1, Gas config: heating duration: 150ms, heater target temperature: 300°C

This method tests for self and other values to be equal, and is used by ==.
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.

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 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.