DeviceSync

Struct DeviceSync 

Source
pub struct DeviceSync {
Show 16 fields pub last_status: Status, pub reset_since_last_contact: bool, pub capabilities: Vec<u32>, pub ownership: HostOwnership, pub host_key: Option<[u8; 32]>, pub phy_enabled: bool, pub freq_khz: u32, pub device_name: String, pub saved: Option<SavedSnapshot>, pub queue_count: Option<u16>, pub queue_dropped: Option<u32>, pub filters: Option<Vec<Filter>>, pub host_channel_ids: Option<Vec<[u8; 2]>>, pub host_peer_keys: Option<Vec<[u8; 32]>>, pub auto_ack: Option<bool>, pub dev_key: Option<[u8; 32]>,
}
Expand description

Device state gathered by UlcpDevice::sync: the spec’s post-attach synchronization procedure. Fields whose capability the device does not advertise are None; multi-value properties are the digest forms and never contain key material.

Fields§

§last_status: Status

Retained PROP_LAST_STATUS.

§reset_since_last_contact: bool

last_status was a reset code: the device has reset since the last host command, so state not restored from a saved snapshot (notably queue contents) has been lost.

§capabilities: Vec<u32>

Advertised PROP_CAPS.

§ownership: HostOwnership

Whether the queued data and provisioning belong to this host.

§host_key: Option<[u8; 32]>

The configured host identity, when one exists.

§phy_enabled: bool

PROP_PHY_ENABLED — with a restored snapshot the PHY may already be up.

§freq_khz: u32

PROP_PHY_FREQ in kHz.

§device_name: String

PROP_DEV_NAME.

§saved: Option<SavedSnapshot>

PROP_SAVED (CAP_SAVE).

§queue_count: Option<u16>

PROP_HOST_RX_QUEUE_COUNT (CAP_HOST_RX_QUEUE).

§queue_dropped: Option<u32>

PROP_HOST_RX_QUEUE_DROPPED (CAP_HOST_RX_QUEUE).

§filters: Option<Vec<Filter>>

PROP_HOST_RX_FILTERS (CAP_HOST_FILTER).

§host_channel_ids: Option<Vec<[u8; 2]>>

Derived channel identifiers of PROP_HOST_CHANNEL_KEYS (CAP_HOST_KEYS).

§host_peer_keys: Option<Vec<[u8; 32]>>

Provisioned peer public keys of PROP_HOST_PEER_KEYS (CAP_HOST_KEYS).

§auto_ack: Option<bool>

PROP_HOST_AUTO_ACK (CAP_HOST_AUTO_ACK).

§dev_key: Option<[u8; 32]>

The device identity public key (CAP_DEV_IDENTITY), when one is configured.

Implementations§

Source§

impl DeviceSync

Source

pub fn has_capability(&self, capability: u32) -> bool

Whether the device advertised this capability code.

Trait Implementations§

Source§

impl Clone for DeviceSync

Source§

fn clone(&self) -> DeviceSync

Returns a duplicate of the value. Read more
1.0.0§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for DeviceSync

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

§

impl<T> Any for T
where T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

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

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

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

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

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

§

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
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T, U> Into<U> for T
where U: From<T>,

§

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> Same for T

Source§

type Output = T

Should always be Self
§

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

§

type Owned = T

The resulting type after obtaining ownership.
§

fn to_owned(&self) -> T

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

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

Uses borrowed data to replace owned data, usually by cloning. Read more
§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

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