pub struct Sensor {
pub id: String,
pub name: String,
pub bands: Vec<Band>,
pub bit_depth: u8,
pub loader_type: String,
pub description: Option<String>,
pub loader_config: HashMap<String, String>,
}Expand description
Sensor configuration that defines how to handle a specific sensor type
Fields§
§id: StringUnique identifier for this sensor
name: StringHuman-readable name
bands: Vec<Band>List of bands in order
bit_depth: u8Bit depth of the sensor data
loader_type: StringLoader type identifier
description: Option<String>Optional description
loader_config: HashMap<String, String>Loader-specific configuration
Implementations§
Source§impl Sensor
impl Sensor
Sourcepub fn new(
id: impl Into<String>,
name: impl Into<String>,
bands: Vec<Band>,
bit_depth: u8,
loader_type: impl Into<String>,
) -> Self
pub fn new( id: impl Into<String>, name: impl Into<String>, bands: Vec<Band>, bit_depth: u8, loader_type: impl Into<String>, ) -> Self
Create a new sensor configuration
Sourcepub fn with_description(self, description: impl Into<String>) -> Self
pub fn with_description(self, description: impl Into<String>) -> Self
Set the description for this sensor
Sourcepub fn with_loader_config(
self,
key: impl Into<String>,
value: impl Into<String>,
) -> Self
pub fn with_loader_config( self, key: impl Into<String>, value: impl Into<String>, ) -> Self
Add a loader configuration parameter
Sourcepub fn default_thresholds(&self) -> Vec<f64>
pub fn default_thresholds(&self) -> Vec<f64>
Get the default thresholds for all bands
Sourcepub fn band_count(&self) -> usize
pub fn band_count(&self) -> usize
Get the number of bands
Sourcepub fn band_names(&self) -> Vec<&str>
pub fn band_names(&self) -> Vec<&str>
Get band names
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Sensor
impl<'de> Deserialize<'de> for Sensor
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl From<Sensor> for SensorConfig
impl From<Sensor> for SensorConfig
Source§impl From<SensorConfig> for Sensor
impl From<SensorConfig> for Sensor
Source§fn from(config: SensorConfig) -> Self
fn from(config: SensorConfig) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for Sensor
impl RefUnwindSafe for Sensor
impl Send for Sensor
impl Sync for Sensor
impl Unpin for Sensor
impl UnsafeUnpin for Sensor
impl UnwindSafe for Sensor
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,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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 more