pub struct KeyValueMap(/* private fields */);Expand description
Wrapper for UA_KeyValueMap from open62541_sys.
Implementations§
Source§impl KeyValueMap
impl KeyValueMap
Sourcepub fn from_slice(slice: &[(&QualifiedName, &Variant)]) -> Self
pub fn from_slice(slice: &[(&QualifiedName, &Variant)]) -> Self
Creates new map from existing elements.
This copies over the elements from the given slice. The map will own the copies, and clean up when it is dropped. The original elements in the slice are left untouched.
§Panics
Enough memory must be available to allocate map.
Sourcepub fn contains(&self, key: &QualifiedName) -> bool
pub fn contains(&self, key: &QualifiedName) -> bool
Checks whether map has key.
Sourcepub fn get(&self, key: &QualifiedName) -> Option<&Variant>
pub fn get(&self, key: &QualifiedName) -> Option<&Variant>
Gets key’s value from map.
Sourcepub fn set(&mut self, key: &QualifiedName, value: &Variant)
pub fn set(&mut self, key: &QualifiedName, value: &Variant)
Sets key’s value in map.
This replaces a previously set value for this key.
§Panics
Enough memory must be available to add value to map.
Sourcepub fn remove(&mut self, key: &QualifiedName) -> bool
pub fn remove(&mut self, key: &QualifiedName) -> bool
Removes key’s value from map.
This returns true if the key was removed, and false if the key did not exist.
Trait Implementations§
Source§impl Debug for KeyValueMap
impl Debug for KeyValueMap
Source§impl Drop for KeyValueMap
impl Drop for KeyValueMap
impl Send for KeyValueMap
impl Sync for KeyValueMap
Auto Trait Implementations§
impl Freeze for KeyValueMap
impl RefUnwindSafe for KeyValueMap
impl Unpin for KeyValueMap
impl UnsafeUnpin for KeyValueMap
impl UnwindSafe for KeyValueMap
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