#[repr(C)]pub struct SensorDescriptor {
pub sensor_type: SensorType,
pub device_id: u64,
pub filter_hash: u64,
pub sample_rate: u32,
}Expand description
Sensor descriptor identifying a data source.
Used in sensor_subscribe to specify which sensor to monitor.
Fields§
§sensor_type: SensorTypeType of sensor.
device_id: u64Device identifier (hardware address, URL hash, stream ID, etc.). Interpretation depends on sensor_type.
filter_hash: u64Filter expression hash (0 = no filter). The actual filter is stored in a region and referenced by hash.
sample_rate: u32Requested sampling rate (events per second). 0 = all events (no downsampling).
Implementations§
Source§impl SensorDescriptor
impl SensorDescriptor
Sourcepub const fn new(sensor_type: SensorType, device_id: u64) -> Self
pub const fn new(sensor_type: SensorType, device_id: u64) -> Self
Creates a new sensor descriptor.
Sourcepub const fn with_sample_rate(self, rate: u32) -> Self
pub const fn with_sample_rate(self, rate: u32) -> Self
Creates a descriptor with sampling rate.
Sourcepub const fn with_filter(self, filter_hash: u64) -> Self
pub const fn with_filter(self, filter_hash: u64) -> Self
Creates a descriptor with a filter.
Sourcepub const fn is_downsampled(&self) -> bool
pub const fn is_downsampled(&self) -> bool
Returns true if downsampling is enabled.
Sourcepub const fn has_filter(&self) -> bool
pub const fn has_filter(&self) -> bool
Returns true if a filter is applied.
Trait Implementations§
Source§impl Clone for SensorDescriptor
impl Clone for SensorDescriptor
Source§fn clone(&self) -> SensorDescriptor
fn clone(&self) -> SensorDescriptor
Returns a duplicate of the value. Read more
1.0.0 · 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 SensorDescriptor
impl Debug for SensorDescriptor
Source§impl Default for SensorDescriptor
impl Default for SensorDescriptor
Source§impl PartialEq for SensorDescriptor
impl PartialEq for SensorDescriptor
impl Copy for SensorDescriptor
impl Eq for SensorDescriptor
impl StructuralPartialEq for SensorDescriptor
Auto Trait Implementations§
impl Freeze for SensorDescriptor
impl RefUnwindSafe for SensorDescriptor
impl Send for SensorDescriptor
impl Sync for SensorDescriptor
impl Unpin for SensorDescriptor
impl UnsafeUnpin for SensorDescriptor
impl UnwindSafe for SensorDescriptor
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