pub struct MockDeviceBuilder { /* private fields */ }Expand description
Builder for creating mock devices with custom settings.
Implementations§
Source§impl MockDeviceBuilder
impl MockDeviceBuilder
Sourcepub fn device_type(self, device_type: DeviceType) -> Self
pub fn device_type(self, device_type: DeviceType) -> Self
Set the device type.
Sourcepub fn temperature(self, temp: f32) -> Self
pub fn temperature(self, temp: f32) -> Self
Set the temperature.
Sourcepub fn auto_connect(self, auto: bool) -> Self
pub fn auto_connect(self, auto: bool) -> Self
Set whether to auto-connect.
Sourcepub fn radon_avg_24h(self, avg: u32) -> Self
pub fn radon_avg_24h(self, avg: u32) -> Self
Set 24-hour average radon concentration in Bq/m³ (AranetRn+ devices).
Sourcepub fn radon_avg_7d(self, avg: u32) -> Self
pub fn radon_avg_7d(self, avg: u32) -> Self
Set 7-day average radon concentration in Bq/m³ (AranetRn+ devices).
Sourcepub fn radon_avg_30d(self, avg: u32) -> Self
pub fn radon_avg_30d(self, avg: u32) -> Self
Set 30-day average radon concentration in Bq/m³ (AranetRn+ devices).
Sourcepub fn radiation_rate(self, rate: f32) -> Self
pub fn radiation_rate(self, rate: f32) -> Self
Set radiation dose rate in µSv/h (Aranet Radiation devices).
Sourcepub fn radiation_total(self, total: f64) -> Self
pub fn radiation_total(self, total: f64) -> Self
Set total radiation dose in mSv (Aranet Radiation devices).
Sourcepub fn build(self) -> MockDevice
pub fn build(self) -> MockDevice
Build the mock device.
Note: This is a sync method that sets initial state directly. The device is created with the specified reading already set.
Trait Implementations§
Source§impl Debug for MockDeviceBuilder
impl Debug for MockDeviceBuilder
Auto Trait Implementations§
impl Freeze for MockDeviceBuilder
impl RefUnwindSafe for MockDeviceBuilder
impl Send for MockDeviceBuilder
impl Sync for MockDeviceBuilder
impl Unpin for MockDeviceBuilder
impl UnwindSafe for MockDeviceBuilder
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more