Struct zvariant::StructureBuilder
source · pub struct StructureBuilder<'a>(_);
Expand description
Use this to efficiently build a Structure
.
Implementations§
source§impl<'a> StructureBuilder<'a>
impl<'a> StructureBuilder<'a>
sourcepub fn add_field<T>(self, field: T) -> Selfwhere
T: DynamicType + Into<Value<'a>>,
pub fn add_field<T>(self, field: T) -> Selfwhere T: DynamicType + Into<Value<'a>>,
Append field
to self
.
This method returns Self
so that you can use the builder pattern to create a complex
structure.
sourcepub fn append_field<'e: 'a>(self, field: Value<'e>) -> Self
pub fn append_field<'e: 'a>(self, field: Value<'e>) -> Self
Append field
to self
.
Identical to add_field
, except the field must be in the form of a Value
.
sourcepub fn push_field<T>(&mut self, field: T)where
T: DynamicType + Into<Value<'a>>,
pub fn push_field<T>(&mut self, field: T)where T: DynamicType + Into<Value<'a>>,
Append field
to self
.
Identical to add_field
, except it makes changes in-place.
sourcepub fn push_value<'e: 'a>(&mut self, field: Value<'e>)
pub fn push_value<'e: 'a>(&mut self, field: Value<'e>)
Append field
to self
.
Identical to append_field
, except it makes changes in-place.
Trait Implementations§
source§impl<'a> Clone for StructureBuilder<'a>
impl<'a> Clone for StructureBuilder<'a>
source§fn clone(&self) -> StructureBuilder<'a>
fn clone(&self) -> StructureBuilder<'a>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl<'a> Debug for StructureBuilder<'a>
impl<'a> Debug for StructureBuilder<'a>
source§impl<'a> Default for StructureBuilder<'a>
impl<'a> Default for StructureBuilder<'a>
source§fn default() -> StructureBuilder<'a>
fn default() -> StructureBuilder<'a>
Returns the “default value” for a type. Read more
source§impl<'a> PartialEq<StructureBuilder<'a>> for StructureBuilder<'a>
impl<'a> PartialEq<StructureBuilder<'a>> for StructureBuilder<'a>
source§fn eq(&self, other: &StructureBuilder<'a>) -> bool
fn eq(&self, other: &StructureBuilder<'a>) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.