Struct flexbuffers::MapBuilder [−][src]
pub struct MapBuilder<'a> { /* fields omitted */ }
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
impl<'a> MapBuilder<'a>
[src]
impl<'a> MapBuilder<'a>
[src]pub fn push<P: Pushable>(&mut self, key: &str, p: P)
[src]
pub fn push<P: Pushable>(&mut self, key: &str, p: P)
[src]Push p
onto this map with key key
.
This will panic (in debug mode) if key
contains internal nulls.
pub fn start_vector(&mut self, key: &str) -> VectorBuilder<'_>
[src]
pub fn start_vector(&mut self, key: &str) -> VectorBuilder<'_>
[src]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.
pub fn start_map(&mut self, key: &str) -> MapBuilder<'_>
[src]
pub fn start_map(&mut self, key: &str) -> MapBuilder<'_>
[src]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.