[][src]Struct cbor_data::ArrayBuilder

pub struct ArrayBuilder<'a, T>(_, _);

Builder for an array value.

Calling the finish() method will return either the fully constructed CBOR value (if this was the top-level array) or the builder of the array or dict into which this array was placed.

If you want to recursively create a CBOR structure without statically known recursion limit then you’ll want to take a look at the WriteToArray::write_array_rec() method (the compiler would otherwise kindly inform you of a type expansion hitting the recursion limit while instantiating your recursive function).

Implementations

impl<'a, T: 'static> ArrayBuilder<'a, T>[src]

pub fn finish(self) -> T[src]

Finish building this array and return to the outer context. In case of a top-level array this returns the complete Cbor value.

pub fn write_array(self, tag: Option<u64>) -> ArrayBuilder<'a, Self>[src]

Write a nested array that is then filled by the returned builder. You can resume building this outer array by using the finish() method.

pub fn write_dict(self, tag: Option<u64>) -> DictBuilder<'a, Self>[src]

Write a nested dict that is then filled by the returned builder. You can resume building this outer array by using the finish() method.

Trait Implementations

impl<'a, T: 'static> WriteToArray for ArrayBuilder<'a, T>[src]

Auto Trait Implementations

impl<'a, T> !RefUnwindSafe for ArrayBuilder<'a, T>[src]

impl<'a, T> !Send for ArrayBuilder<'a, T>[src]

impl<'a, T> !Sync for ArrayBuilder<'a, T>[src]

impl<'a, T> Unpin for ArrayBuilder<'a, T>[src]

impl<'a, T> !UnwindSafe for ArrayBuilder<'a, T>[src]

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.