pub struct IotData {
pub resources: BTreeMap<String, BTreeMap<String, Value>>,
pub tags: BTreeMap<String, BTreeMap<String, String>>,
pub singletons: BTreeMap<String, Value>,
pub relations: BTreeMap<String, Vec<String>>,
pub seq: u64,
}Expand description
Per-account IoT Core control-plane state.
Fields§
§resources: BTreeMap<String, BTreeMap<String, Value>>resource_type -> id -> record. The record is the resource’s persisted
JSON attributes plus any minted ARN / id / timestamps.
Resource tags keyed by ARN.
singletons: BTreeMap<String, Value>Account-scoped singleton configurations keyed by a stable string.
relations: BTreeMap<String, Vec<String>>Many-to-many relationship sets keyed by a stable string.
seq: u64Monotonic counter used to mint unique ids within an account.
Implementations§
Source§impl IotData
impl IotData
Sourcepub fn get_resource(&self, rtype: &str, id: &str) -> Option<&Value>
pub fn get_resource(&self, rtype: &str, id: &str) -> Option<&Value>
Fetch a resource record by type + id.
Sourcepub fn put_resource(&mut self, rtype: &str, id: &str, record: Value)
pub fn put_resource(&mut self, rtype: &str, id: &str, record: Value)
Insert / replace a resource record.
Sourcepub fn remove_resource(&mut self, rtype: &str, id: &str) -> Option<Value>
pub fn remove_resource(&mut self, rtype: &str, id: &str) -> Option<Value>
Remove a resource record, returning it if present.
Sourcepub fn list_resources(&self, rtype: &str) -> Vec<Value>
pub fn list_resources(&self, rtype: &str) -> Vec<Value>
All records of a type, ordered by id.
Trait Implementations§
Source§impl AccountState for IotData
impl AccountState for IotData
Source§fn new_for_account(_account_id: &str, _region: &str, _endpoint: &str) -> Self
fn new_for_account(_account_id: &str, _region: &str, _endpoint: &str) -> Self
Create a fresh, empty state for the given account.
Source§fn inherit_from(&mut self, _sibling: &Self)
fn inherit_from(&mut self, _sibling: &Self)
Called after a new account state is created via
MultiAccountState::get_or_create,
with a reference to an existing sibling state. Services can override
this to propagate shared resources (e.g. body caches) to the new state.Source§impl<'de> Deserialize<'de> for IotData
impl<'de> Deserialize<'de> for IotData
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 IotData
impl RefUnwindSafe for IotData
impl Send for IotData
impl Sync for IotData
impl Unpin for IotData
impl UnsafeUnpin for IotData
impl UnwindSafe for IotData
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