pub struct SensorRegistry { /* private fields */ }Expand description
Registry for managing sensor configurations
Implementations§
Source§impl SensorRegistry
impl SensorRegistry
Sourcepub fn with_defaults() -> Self
pub fn with_defaults() -> Self
Create a registry with default sensors loaded from built-in TOML
Sourcepub fn from_user_config() -> Self
pub fn from_user_config() -> Self
Create a registry with sensors loaded from user config, falling back to defaults
Sourcepub fn register_sensor(&mut self, sensor: Sensor) -> Result<()>
pub fn register_sensor(&mut self, sensor: Sensor) -> Result<()>
Register a new sensor
Sourcepub fn get_sensor(&self, id: &str) -> Option<&Sensor>
pub fn get_sensor(&self, id: &str) -> Option<&Sensor>
Get a sensor by ID
Sourcepub fn sensor_ids(&self) -> Vec<&str>
pub fn sensor_ids(&self) -> Vec<&str>
Get all registered sensor IDs
Sourcepub fn remove_sensor(&mut self, id: &str) -> Option<Sensor>
pub fn remove_sensor(&mut self, id: &str) -> Option<Sensor>
Remove a sensor
Sourcepub fn has_sensor(&self, id: &str) -> bool
pub fn has_sensor(&self, id: &str) -> bool
Check if a sensor is registered
Sourcepub fn load_from_file(&mut self, path: &Path) -> Result<()>
pub fn load_from_file(&mut self, path: &Path) -> Result<()>
Load sensors from a configuration file
Sourcepub fn save_to_file(&self, path: &Path) -> Result<()>
pub fn save_to_file(&self, path: &Path) -> Result<()>
Save sensors to a configuration file
Trait Implementations§
Source§impl Clone for SensorRegistry
impl Clone for SensorRegistry
Source§fn clone(&self) -> SensorRegistry
fn clone(&self) -> SensorRegistry
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SensorRegistry
impl Debug for SensorRegistry
Auto Trait Implementations§
impl Freeze for SensorRegistry
impl RefUnwindSafe for SensorRegistry
impl Send for SensorRegistry
impl Sync for SensorRegistry
impl Unpin for SensorRegistry
impl UnsafeUnpin for SensorRegistry
impl UnwindSafe for SensorRegistry
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
Read this value from the supplied reader. Same as
ReadEndian::read_from_little_endian().