pub struct DeviceShadow { /* private fields */ }
Expand description

DeviceShadow holds the attributes for handling a shadow

  • shadow_value : JSON values of the shadow
  • eventloop_handle : handle for communocating with the cloud shadow
  • shadow_topic : ShadowTopic

Implementations

Get Device Shadow prefix, e.g., AWS specific

Get Device Shadow prefix, e.g., AWS specific

Get Device Shadow topic, e.g., AWS specific.

Get Shadow Name from topic, e.g., “$aws/things/{}/shadow/name/{}/”

Builds either UPDATE reported or UPDATE desired-and-reported Iot Message

The retrieve_shadow_delivery function

  1. performs actions on the general DeviceShadow
  2. stores the delivered payload
  3. returns following sub-branch to be processed by device specific function
    a. Response UPDATE_ACCEPTED: state.desired.* b. Response UPDATE_DELTA: state.* c. Response UPDATE_DOCUMENTS: current.state.desired.* d. Response GET_ACCEPTED: state.desired.* e. all other responses return serde_json::Value::Null Remark: The device specific processing of the “documents”, “delta” and “update” shadow responses (particularly containing incremental changes only) will be done in the Device Adapter.

Helper function to

  • subscribe to all prefixes of a DeviceShadow and
  • initiate GET of the remote shadow by sending the message to the IoT sender via MPSC channel

Trait Implementations

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Should always be Self

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.