pub struct Map<'a> { /* private fields */ }Expand description
Container that stores its elements with numeric keys and provides
get by key access. Keys are of i32 type
Implementations§
Source§impl<'a> Map<'a>
impl<'a> Map<'a>
Sourcepub fn add_value<'c, 'p: 'c, 'd>(
&'p mut self,
key: i32,
value: impl AsValue<'d>,
) -> Result<Value<'c>, Error>
pub fn add_value<'c, 'p: 'c, 'd>( &'p mut self, key: i32, value: impl AsValue<'d>, ) -> Result<Value<'c>, Error>
Adds new field with given name and value to this object
Sourcepub fn as_bytes(&self) -> &[u8] ⓘ
pub fn as_bytes(&self) -> &[u8] ⓘ
Returns slice of bytes representing current document.
It’s guaranteed to be subslice of initial buffer and for root document it will starting at 0.
So by taking it’s len you can get how many bytes in buffer are used
Sourcepub fn empty() -> Map<'static>
pub fn empty() -> Map<'static>
Returns new empty object
Object is read only so no new elements can be added to it
Trait Implementations§
impl<'a> Eq for Map<'a>
impl<'a> StructuralPartialEq for Map<'a>
Auto Trait Implementations§
impl<'a> Freeze for Map<'a>
impl<'a> RefUnwindSafe for Map<'a>
impl<'a> !Send for Map<'a>
impl<'a> !Sync for Map<'a>
impl<'a> Unpin for Map<'a>
impl<'a> UnwindSafe for Map<'a>
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