pub struct DeviceMetadata {
pub device_id: DeviceId,
pub status: DeviceStatus,
pub last_seen: Timestamp,
pub clock: VectorClock,
pub metadata: HashMap<String, String>,
}Expand description
Device metadata
Fields§
§device_id: DeviceIdDevice identifier
status: DeviceStatusCurrent status
last_seen: TimestampLast seen timestamp
clock: VectorClockVector clock for this device
metadata: HashMap<String, String>Custom metadata
Implementations§
Source§impl DeviceMetadata
impl DeviceMetadata
Sourcepub fn update_last_seen(&mut self)
pub fn update_last_seen(&mut self)
Updates the last seen timestamp
Sourcepub fn set_status(&mut self, status: DeviceStatus)
pub fn set_status(&mut self, status: DeviceStatus)
Sets device status
Trait Implementations§
Source§impl Clone for DeviceMetadata
impl Clone for DeviceMetadata
Source§fn clone(&self) -> DeviceMetadata
fn clone(&self) -> DeviceMetadata
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 DeviceMetadata
impl Debug for DeviceMetadata
Source§impl<'de> Deserialize<'de> for DeviceMetadata
impl<'de> Deserialize<'de> for DeviceMetadata
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
Auto Trait Implementations§
impl Freeze for DeviceMetadata
impl RefUnwindSafe for DeviceMetadata
impl Send for DeviceMetadata
impl Sync for DeviceMetadata
impl Unpin for DeviceMetadata
impl UnsafeUnpin for DeviceMetadata
impl UnwindSafe for DeviceMetadata
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