pub struct StructureBuilder<'a>(/* private fields */);
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) -> Self
pub fn add_field<T>(self, field: T) -> Self
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)
pub fn push_field<T>(&mut self, field: T)
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 for StructureBuilder<'a>
impl<'a> PartialEq for StructureBuilder<'a>
impl<'a> StructuralPartialEq for StructureBuilder<'a>
Auto Trait Implementations§
impl<'a> Freeze for StructureBuilder<'a>
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§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)