client-api: Make device::Device non-exhaustive
This commit is contained in:
parent
dd5b2db4d5
commit
d14213ab3e
@ -13,6 +13,7 @@ pub mod update_device;
|
|||||||
|
|
||||||
/// Information about a registered device.
|
/// Information about a registered device.
|
||||||
#[derive(Clone, Debug, Deserialize, Hash, PartialEq, Serialize)]
|
#[derive(Clone, Debug, Deserialize, Hash, PartialEq, Serialize)]
|
||||||
|
#[cfg_attr(not(feature = "unstable-exhaustive-types"), non_exhaustive)]
|
||||||
pub struct Device {
|
pub struct Device {
|
||||||
/// Device ID
|
/// Device ID
|
||||||
pub device_id: DeviceIdBox,
|
pub device_id: DeviceIdBox,
|
||||||
@ -31,3 +32,10 @@ pub struct Device {
|
|||||||
)]
|
)]
|
||||||
pub last_seen_ts: Option<SystemTime>,
|
pub last_seen_ts: Option<SystemTime>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl Device {
|
||||||
|
/// Creates a new `Device` with the given device ID.
|
||||||
|
pub fn new(device_id: DeviceIdBox) -> Self {
|
||||||
|
Self { device_id, display_name: None, last_seen_ip: None, last_seen_ts: None }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user