Struct zvariant::StructureBuilder[][src]

pub struct StructureBuilder<'a>(_);

Use this to efficiently build a Structure.


impl<'a> StructureBuilder<'a>[src]

pub fn new() -> Self[src]

Create a new StructureBuilder.

Same as StructureBuilder::default().

pub fn add_field<T>(self, field: T) -> Self where
    T: Type + Into<Value<'a>>, 

Append field to self.

This method returns Self so that you can use the builder pattern to create a complex structure.

pub fn append_field<'e: 'a>(self, field: Value<'e>) -> Self[src]

Append field to self.

Identical to add_field, except the field must be in the form of a Value.

pub fn build(self) -> Structure<'a>[src]

Build the Structure.

Trait Implementations

impl<'a> Clone for StructureBuilder<'a>[src]

impl<'a> Debug for StructureBuilder<'a>[src]

impl<'a> Default for StructureBuilder<'a>[src]

impl<'a> PartialEq<StructureBuilder<'a>> for StructureBuilder<'a>[src]

impl<'a> StructuralPartialEq for StructureBuilder<'a>[src]

Auto Trait Implementations

impl<'a> RefUnwindSafe for StructureBuilder<'a>

impl<'a> Send for StructureBuilder<'a>

impl<'a> Sync for StructureBuilder<'a>

impl<'a> Unpin for StructureBuilder<'a>

impl<'a> UnwindSafe for StructureBuilder<'a>

Blanket Implementations

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

impl<T> Borrow<T> for T where
    T: ?Sized

impl<T> BorrowMut<T> for T where
    T: ?Sized

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

impl<T, U> Into<U> for T where
    U: From<T>, 

impl<T> ToOwned for T where
    T: Clone

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 

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

The type returned in the event of a conversion error.