pub struct ThingMapping {
pub thing_id: ThingId,
pub bindings: BTreeMap<PropertyPath, ProtocolBinding>,
}Expand description
Mapping of every PropertyPath in one Thing onto its protocol
address.
In no_std + alloc, BTreeMap is the canonical container; it is
O(log n) and deterministic, both of which matter for industrial
devices.
Fields§
§thing_id: ThingIdOwning Thing.
bindings: BTreeMap<PropertyPath, ProtocolBinding>Address of every bound property.
Implementations§
Source§impl ThingMapping
impl ThingMapping
Sourcepub fn bind(
&mut self,
path: PropertyPath,
binding: ProtocolBinding,
) -> Option<ProtocolBinding>
pub fn bind( &mut self, path: PropertyPath, binding: ProtocolBinding, ) -> Option<ProtocolBinding>
Bind one path. Returns the previous binding if any.
Sourcepub fn get(&self, path: &PropertyPath) -> Option<&ProtocolBinding>
pub fn get(&self, path: &PropertyPath) -> Option<&ProtocolBinding>
Look up a binding.
Trait Implementations§
Source§impl Clone for ThingMapping
impl Clone for ThingMapping
Source§fn clone(&self) -> ThingMapping
fn clone(&self) -> ThingMapping
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 ThingMapping
impl Debug for ThingMapping
Source§impl<'de> Deserialize<'de> for ThingMapping
impl<'de> Deserialize<'de> for ThingMapping
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
Source§impl PartialEq for ThingMapping
impl PartialEq for ThingMapping
Source§impl Serialize for ThingMapping
impl Serialize for ThingMapping
impl StructuralPartialEq for ThingMapping
Auto Trait Implementations§
impl Freeze for ThingMapping
impl RefUnwindSafe for ThingMapping
impl Send for ThingMapping
impl Sync for ThingMapping
impl Unpin for ThingMapping
impl UnsafeUnpin for ThingMapping
impl UnwindSafe for ThingMapping
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