Skip to main content

SensorEvent

Enum SensorEvent 

Source
pub enum SensorEvent {
Show 47 variants CachedDataLoaded { devices: Vec<CachedDevice>, }, ScanStarted, ScanComplete { devices: Vec<DiscoveredDevice>, }, ScanError { error: String, }, DeviceConnecting { device_id: String, }, DeviceConnected { device_id: String, name: Option<String>, device_type: Option<DeviceType>, rssi: Option<i16>, }, DeviceDisconnected { device_id: String, }, ConnectionError { device_id: String, error: String, context: Option<ErrorContext>, }, ReadingUpdated { device_id: String, reading: CurrentReading, }, ReadingError { device_id: String, error: String, context: Option<ErrorContext>, }, HistoryLoaded { device_id: String, records: Vec<HistoryRecord>, }, HistorySyncStarted { device_id: String, total_records: Option<u16>, }, HistorySyncProgress { device_id: String, downloaded: usize, total: usize, }, HistorySynced { device_id: String, count: usize, }, HistorySyncError { device_id: String, error: String, context: Option<ErrorContext>, }, IntervalChanged { device_id: String, interval_secs: u16, }, IntervalError { device_id: String, error: String, context: Option<ErrorContext>, }, SettingsLoaded { device_id: String, settings: DeviceSettings, }, BluetoothRangeChanged { device_id: String, extended: bool, }, BluetoothRangeError { device_id: String, error: String, context: Option<ErrorContext>, }, SmartHomeChanged { device_id: String, enabled: bool, }, SmartHomeError { device_id: String, error: String, context: Option<ErrorContext>, }, ServiceStatusRefreshed { reachable: bool, collector_running: bool, uptime_seconds: Option<u64>, devices: Vec<ServiceDeviceStats>, }, ServiceStatusError { error: String, }, ServiceCollectorStarted, ServiceCollectorStopped, ServiceCollectorError { error: String, }, AliasChanged { device_id: String, alias: Option<String>, }, AliasError { device_id: String, error: String, }, DeviceForgotten { device_id: String, }, ForgetDeviceError { device_id: String, error: String, }, OperationCancelled { operation: String, }, BackgroundPollingStarted { device_id: String, interval_secs: u64, }, BackgroundPollingStopped { device_id: String, }, SignalStrengthUpdate { device_id: String, rssi: i16, quality: SignalQuality, }, SystemServiceStatus { installed: bool, running: bool, }, SystemServiceInstalled, SystemServiceUninstalled, SystemServiceStarted, SystemServiceStopped, SystemServiceError { operation: String, error: String, }, ServiceConfigFetched { devices: Vec<ServiceMonitoredDevice>, }, ServiceConfigError { error: String, }, ServiceDeviceAdded { device: ServiceMonitoredDevice, }, ServiceDeviceUpdated { device: ServiceMonitoredDevice, }, ServiceDeviceRemoved { address: String, }, ServiceDeviceError { operation: String, error: String, },
}
Expand description

Events sent from the background worker to the UI thread.

These events represent the results of background operations and are used to update the UI state.

Variants§

§

CachedDataLoaded

Cached data loaded from the store on startup.

Fields

§devices: Vec<CachedDevice>

Cached devices with their latest readings.

§

ScanStarted

A device scan has started.

§

ScanComplete

A device scan has completed successfully.

Fields

§devices: Vec<DiscoveredDevice>

The list of discovered devices.

§

ScanError

A device scan failed.

Fields

§error: String

Description of the error.

§

DeviceConnecting

Attempting to connect to a device.

Fields

§device_id: String

The device identifier.

§

DeviceConnected

Successfully connected to a device.

Fields

§device_id: String

The device identifier.

§name: Option<String>

The device name, if available.

§device_type: Option<DeviceType>

The device type, if detected.

§rssi: Option<i16>

RSSI signal strength in dBm.

§

DeviceDisconnected

Disconnected from a device.

Fields

§device_id: String

The device identifier.

§

ConnectionError

Failed to connect to a device.

Fields

§device_id: String

The device identifier.

§error: String

Description of the error.

§context: Option<ErrorContext>

Additional error context with retry info.

§

ReadingUpdated

Received an updated reading from a device.

Fields

§device_id: String

The device identifier.

§reading: CurrentReading

The current sensor reading.

§

ReadingError

Failed to read from a device.

Fields

§device_id: String

The device identifier.

§error: String

Description of the error.

§context: Option<ErrorContext>

Additional error context with retry info.

§

HistoryLoaded

Historical data loaded for a device.

Fields

§device_id: String

The device identifier.

§records: Vec<HistoryRecord>

The historical records.

§

HistorySyncStarted

History sync started for a device.

Fields

§device_id: String

The device identifier.

§total_records: Option<u16>

Total number of records to download (if known).

§

HistorySyncProgress

History sync progress update.

Fields

§device_id: String

The device identifier.

§downloaded: usize

Number of records downloaded so far.

§total: usize

Total number of records to download.

§

HistorySynced

History sync completed for a device.

Fields

§device_id: String

The device identifier.

§count: usize

Number of records synced.

§

HistorySyncError

History sync failed for a device.

Fields

§device_id: String

The device identifier.

§error: String

Description of the error.

§context: Option<ErrorContext>

Additional error context with retry info.

§

IntervalChanged

Measurement interval changed for a device.

Fields

§device_id: String

The device identifier.

§interval_secs: u16

The new interval in seconds.

§

IntervalError

Failed to set measurement interval.

Fields

§device_id: String

The device identifier.

§error: String

Description of the error.

§context: Option<ErrorContext>

Additional error context with retry info.

§

SettingsLoaded

Device settings loaded from the device.

Fields

§device_id: String

The device identifier.

§settings: DeviceSettings

The device settings.

§

BluetoothRangeChanged

Bluetooth range changed for a device.

Fields

§device_id: String

The device identifier.

§extended: bool

Whether extended range is now enabled.

§

BluetoothRangeError

Failed to set Bluetooth range.

Fields

§device_id: String

The device identifier.

§error: String

Description of the error.

§context: Option<ErrorContext>

Additional error context with retry info.

§

SmartHomeChanged

Smart Home setting changed for a device.

Fields

§device_id: String

The device identifier.

§enabled: bool

Whether Smart Home mode is now enabled.

§

SmartHomeError

Failed to set Smart Home mode.

Fields

§device_id: String

The device identifier.

§error: String

Description of the error.

§context: Option<ErrorContext>

Additional error context with retry info.

§

ServiceStatusRefreshed

Service status refreshed successfully.

Fields

§reachable: bool

Whether the service is reachable.

§collector_running: bool

Whether the collector is running.

§uptime_seconds: Option<u64>

Service uptime in seconds.

§devices: Vec<ServiceDeviceStats>

Monitored devices with their collection stats.

§

ServiceStatusError

Service status refresh failed.

Fields

§error: String

Description of the error.

§

ServiceCollectorStarted

Service collector started successfully.

§

ServiceCollectorStopped

Service collector stopped successfully.

§

ServiceCollectorError

Service collector action failed.

Fields

§error: String

Description of the error.

§

AliasChanged

Device alias changed successfully.

Fields

§device_id: String

The device identifier.

§alias: Option<String>

The new alias (or None if cleared).

§

AliasError

Failed to set device alias.

Fields

§device_id: String

The device identifier.

§error: String

Description of the error.

§

DeviceForgotten

Device was forgotten (removed from known devices).

Fields

§device_id: String

The device identifier.

§

ForgetDeviceError

Failed to forget device.

Fields

§device_id: String

The device identifier.

§error: String

Description of the error.

§

OperationCancelled

An operation was cancelled by user request.

Fields

§operation: String

Description of what was cancelled.

§

BackgroundPollingStarted

Background polling started for a device.

Fields

§device_id: String

The device identifier.

§interval_secs: u64

Polling interval in seconds.

§

BackgroundPollingStopped

Background polling stopped for a device.

Fields

§device_id: String

The device identifier.

§

SignalStrengthUpdate

Signal strength update (can be sent periodically or on connect).

Fields

§device_id: String

The device identifier.

§rssi: i16

RSSI in dBm.

§quality: SignalQuality

Quality assessment.

§

SystemServiceStatus

System service status retrieved.

Fields

§installed: bool

Whether the service is installed.

§running: bool

Whether the service is running.

§

SystemServiceInstalled

System service was installed successfully.

§

SystemServiceUninstalled

System service was uninstalled successfully.

§

SystemServiceStarted

System service was started successfully.

§

SystemServiceStopped

System service was stopped successfully.

§

SystemServiceError

System service operation failed.

Fields

§operation: String

The operation that failed.

§error: String

Description of the error.

§

ServiceConfigFetched

Service configuration fetched.

Fields

§devices: Vec<ServiceMonitoredDevice>

List of monitored devices in service config.

§

ServiceConfigError

Failed to fetch service configuration.

Fields

§error: String

Error message.

§

ServiceDeviceAdded

Device added to service monitoring.

Fields

§device: ServiceMonitoredDevice

The device that was added.

§

ServiceDeviceUpdated

Device updated in service monitoring.

Fields

§device: ServiceMonitoredDevice

The device that was updated.

§

ServiceDeviceRemoved

Device removed from service monitoring.

Fields

§address: String

The device address that was removed.

§

ServiceDeviceError

Failed to modify service device.

Fields

§operation: String

The operation that failed.

§error: String

Error message.

Trait Implementations§

Source§

impl Clone for SensorEvent

Source§

fn clone(&self) -> SensorEvent

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for SensorEvent

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. 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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

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

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more