pub struct DeviceState {Show 24 fields
pub id: String,
pub mac: Option<String>,
pub port_path: Option<String>,
pub baud_rate: Option<u32>,
pub serial_connected: Option<bool>,
pub collection_running: Option<bool>,
pub firmware_verified: Option<bool>,
pub fault: Option<String>,
pub latest_info: Option<DeviceInfo>,
pub forms: DeviceForms,
pub latest_config: Option<DeviceConfig>,
pub auto_resetting_cache: bool,
pub ws_connected: bool,
pub frames_received: u64,
pub bytes_received: u64,
pub recent_frames: Vec<FrameSummary>,
pub auto_scroll_stream: bool,
pub details_loaded: bool,
pub config_path: String,
pub copy_source: String,
pub recording: bool,
pub record_path: Option<String>,
pub recorded_frames: u64,
pub record_decode_errors: u64,
}Expand description
Complete per-device state: identity, config forms, status, and stream.
Every attached device discovered via GET /api/devices owns one of these.
State is fully isolated per device, matching the server’s per-device model.
Fields§
§id: StringStable device id used to build /api/devices/{id}/... paths.
mac: Option<String>Stable board MAC when reported by the webserver (USB iSerialNumber).
port_path: Option<String>§baud_rate: Option<u32>§serial_connected: Option<bool>§collection_running: Option<bool>§firmware_verified: Option<bool>§fault: Option<String>Chip fault reported by the webserver (e.g. the ESP32-C5/C6 USB-JTAG
reset-loop wedge), including the recovery action. None = healthy.
latest_info: Option<DeviceInfo>§forms: DeviceForms§latest_config: Option<DeviceConfig>§auto_resetting_cache: boolGuards against an infinite reset/fetch loop when an empty fetch
auto-issues config/reset and the follow-up fetch is also empty.
ws_connected: bool§frames_received: u64§bytes_received: u64§recent_frames: Vec<FrameSummary>§auto_scroll_stream: bool§details_loaded: boolTrue once the one-time info/config/status fetch has been issued for this freshly-discovered device.
config_path: StringConfig snapshot file path in the Config tab; empty = auto-name on save.
copy_source: StringDevice id selected in the “Copy from” picker on the Config tab.
recording: boolTrue while this device’s stream is being recorded to a Parquet file.
record_path: Option<String>Output path of the current (or most recent) recording.
recorded_frames: u64Frames written to the active recording.
record_decode_errors: u64Frames the recorder could not decode (wire drift / truncation).
Implementations§
Source§impl DeviceState
impl DeviceState
Sourcepub fn apply_list_entry(&mut self, entry: &DeviceListEntry)
pub fn apply_list_entry(&mut self, entry: &DeviceListEntry)
Refresh the live status fields from a GET /api/devices list entry.
This keeps the dashboard/fleet view current on every discovery poll without per-device round-trips.
Sourcepub fn push_frame(&mut self, bytes: &[u8])
pub fn push_frame(&mut self, bytes: &[u8])
Record one received frame and update stream counters/history.
Sourcepub fn clear_frames(&mut self)
pub fn clear_frames(&mut self)
Clear stream frames and counters for this device.
Sourcepub fn apply_control_status(&mut self, status: ControlStatus)
pub fn apply_control_status(&mut self, status: ControlStatus)
Apply a control/status payload to this device’s runtime status.
Sourcepub fn apply_device_config(&mut self, config: DeviceConfig) -> usize
pub fn apply_device_config(&mut self, config: DeviceConfig) -> usize
Apply server config payload into this device’s form fields.
Returns the number of fields that were actually applied; callers use a zero return to detect an empty server cache.
Source§impl DeviceState
impl DeviceState
Sourcepub fn supports_v07_modes(&self) -> bool
pub fn supports_v07_modes(&self) -> bool
True when cached firmware info supports v0.7.0 modes.
Sourcepub fn supports_unsolicited(&self) -> bool
pub fn supports_unsolicited(&self) -> bool
True when cached firmware info supports set-traffic --unsolicited.
Trait Implementations§
Source§impl Clone for DeviceState
impl Clone for DeviceState
Source§fn clone(&self) -> DeviceState
fn clone(&self) -> DeviceState
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for DeviceState
impl RefUnwindSafe for DeviceState
impl Send for DeviceState
impl Sync for DeviceState
impl Unpin for DeviceState
impl UnsafeUnpin for DeviceState
impl UnwindSafe for DeviceState
Blanket Implementations§
impl<T> Allocation for T
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.