[][src]Struct flexbuffers::MapBuilder

pub struct MapBuilder<'a> { /* fields omitted */ }

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]

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]

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]

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.

pub fn end_map(self)[src]

end_map sorts the map by key and writes it to the buffer. This happens anyway when the map builder is dropped.

Trait Implementations

impl<'a> Drop for MapBuilder<'a>[src]

Auto Trait Implementations

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

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.