pub struct MapBuilder<'a> { /* private fields */ }
Expand description
Builds a Flexbuffer map, returned by a Builder.
§Side effect when dropped:
When this is dropped, or end_map
is called, the map is
commited to the buffer. If this map is the root of the flexbuffer, then the
root is written and the flexbuffer is complete.
§Panics:
- Duplicate keys will result in a panic in both debug and release mode.
- Keys with internal nulls results in a panic in debug mode and result in silent truncaction in release mode.
Implementations§
Source§impl<'a> MapBuilder<'a>
impl<'a> MapBuilder<'a>
Sourcepub fn push<P: Pushable>(&mut self, key: &str, p: P)
pub fn push<P: Pushable>(&mut self, key: &str, p: P)
Push p
onto this map with key key
.
This will panic (in debug mode) if key
contains internal nulls.
Sourcepub fn start_vector(&mut self, key: &str) -> VectorBuilder<'_>
pub fn start_vector(&mut self, key: &str) -> VectorBuilder<'_>
Starts a nested vector that will be pushed onto this map
with key key
when it is dropped.
This will panic (in debug mode) if key
contains internal nulls.
Sourcepub fn start_map(&mut self, key: &str) -> MapBuilder<'_>
pub fn start_map(&mut self, key: &str) -> MapBuilder<'_>
Starts a nested map which that will be pushed onto this map
with key key
when it is dropped.
This will panic (in debug mode) if key
contains internal nulls.
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for MapBuilder<'a>
impl<'a> RefUnwindSafe for MapBuilder<'a>
impl<'a> Send for MapBuilder<'a>
impl<'a> Sync for MapBuilder<'a>
impl<'a> Unpin for MapBuilder<'a>
impl<'a> !UnwindSafe for MapBuilder<'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