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> 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