Struct zvariant::StructureBuilder
source · [−]pub struct StructureBuilder<'a>(_);
Expand description
Use this to efficiently build a Structure
.
Implementations
sourceimpl<'a> StructureBuilder<'a>
impl<'a> StructureBuilder<'a>
sourcepub fn add_field<T>(self, field: T) -> Self where
T: DynamicType + Into<Value<'a>>,
pub fn add_field<T>(self, field: T) -> Self where
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
sourceimpl<'a> Clone for StructureBuilder<'a>
impl<'a> Clone for StructureBuilder<'a>
sourcefn clone(&self) -> StructureBuilder<'a>
fn clone(&self) -> StructureBuilder<'a>
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl<'a> Debug for StructureBuilder<'a>
impl<'a> Debug for StructureBuilder<'a>
sourceimpl<'a> Default for StructureBuilder<'a>
impl<'a> Default for StructureBuilder<'a>
sourcefn default() -> StructureBuilder<'a>
fn default() -> StructureBuilder<'a>
Returns the “default value” for a type. Read more
sourceimpl<'a> PartialEq<StructureBuilder<'a>> for StructureBuilder<'a>
impl<'a> PartialEq<StructureBuilder<'a>> for StructureBuilder<'a>
sourcefn 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 ==
. Read more
sourcefn ne(&self, other: &StructureBuilder<'a>) -> bool
fn ne(&self, other: &StructureBuilder<'a>) -> bool
This method tests for !=
.
impl<'a> StructuralPartialEq for StructureBuilder<'a>
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
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more