pub struct TeaLeafBuilder { /* private fields */ }Expand description
Implementations§
Source§impl TeaLeafBuilder
impl TeaLeafBuilder
Sourcepub fn add<T: ToTeaLeaf>(self, key: &str, dto: &T) -> Self
pub fn add<T: ToTeaLeaf>(self, key: &str, dto: &T) -> Self
Add a single DTO under the given key.
Sourcepub fn add_value(self, key: &str, value: Value) -> Self
pub fn add_value(self, key: &str, value: Value) -> Self
Add a raw Value under the given key (no schema collection).
Sourcepub fn add_schema(self, schema: Schema) -> Self
pub fn add_schema(self, schema: Schema) -> Self
Add a schema definition.
Sourcepub fn add_vec<T: ToTeaLeaf>(self, key: &str, items: &[T]) -> Self
pub fn add_vec<T: ToTeaLeaf>(self, key: &str, items: &[T]) -> Self
Add a Vec of DTOs as an array under the given key.
Sourcepub fn root_array(self) -> Self
pub fn root_array(self) -> Self
Mark the document as a root array (for JSON round-trip fidelity).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for TeaLeafBuilder
impl RefUnwindSafe for TeaLeafBuilder
impl Send for TeaLeafBuilder
impl Sync for TeaLeafBuilder
impl Unpin for TeaLeafBuilder
impl UnwindSafe for TeaLeafBuilder
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