SettingsBuilder

Struct SettingsBuilder 

Source
pub struct SettingsBuilder { /* private fields */ }
Expand description

Builder to construct the desired settings

§Example

use bme680::{IIRFilterSize, OversamplingSetting, SettingsBuilder};
use std::time::Duration;
let settings = SettingsBuilder::default()
    .with_humidity_oversampling(OversamplingSetting::OS2x)
    .with_pressure_oversampling(OversamplingSetting::OS4x)
    .with_temperature_oversampling(OversamplingSetting::OS8x)
    .with_temperature_filter(IIRFilterSize::Size3)
    .with_gas_measurement(Duration::from_millis(1500), 320, 25)
    .with_temperature_offset(-4.25)
    .with_run_gas(true)
    .build();

Implementations§

Source§

impl SettingsBuilder

Source

pub fn new() -> SettingsBuilder

Source

pub fn with_temperature_filter(self, filter: IIRFilterSize) -> SettingsBuilder

Source

pub fn with_humidity_control(self, heatr_control: u8) -> SettingsBuilder

Source

pub fn with_temperature_oversampling( self, os_temp: OversamplingSetting, ) -> SettingsBuilder

Source

pub fn with_pressure_oversampling( self, os_pres: OversamplingSetting, ) -> SettingsBuilder

Source

pub fn with_humidity_oversampling( self, os_hum: OversamplingSetting, ) -> SettingsBuilder

Source

pub fn with_gas_measurement( self, heatr_dur: Duration, heatr_temp: u16, ambient_temperature: i8, ) -> SettingsBuilder

Source

pub fn with_nb_conv(self, nb_conv: u8) -> SettingsBuilder

Source

pub fn with_run_gas(self, run_gas: bool) -> SettingsBuilder

Source

pub fn with_temperature_offset(self, offset: f32) -> SettingsBuilder

Temperature offset in Celsius, e.g. 4, -8, 1.25

Source

pub fn build(self) -> Settings

Trait Implementations§

Source§

impl Default for SettingsBuilder

Source§

fn default() -> SettingsBuilder

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.