pub struct NrMap { /* private fields */ }Expand description
A map/dictionary type implemented as a vector of key-value pairs with hash index.
This struct is #[repr(C)] and ABI-stable.
Implementations§
Source§impl NrMap
impl NrMap
pub fn new() -> Self
pub fn insert(&mut self, key: &str, value: NrAny)
Sourcepub unsafe fn insert_nr(
&mut self,
key: NrStr,
value: NrAny,
) -> Result<(), NrViewError>
pub unsafe fn insert_nr( &mut self, key: NrStr, value: NrAny, ) -> Result<(), NrViewError>
Copies an ABI string key and inserts the value.
§Safety
key must point to readable memory for its declared length.
pub fn get(&self, key: &str) -> Option<&NrAny>
pub fn get_mut(&mut self, key: &str) -> Option<&mut NrAny>
pub fn remove(&mut self, key: &str) -> Option<NrKVAny>
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn clear(&mut self)
Trait Implementations§
impl Send for NrMap
impl Sync for NrMap
Auto Trait Implementations§
impl Freeze for NrMap
impl RefUnwindSafe for NrMap
impl Unpin for NrMap
impl UnsafeUnpin for NrMap
impl UnwindSafe for NrMap
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