pub struct JsonObjectFactory { /* private fields */ }Expand description
Factory for building JSON objects.
Implementations§
Source§impl JsonObjectFactory
impl JsonObjectFactory
Sourcepub fn string(self, key: impl Into<String>, value: impl Into<String>) -> Self
pub fn string(self, key: impl Into<String>, value: impl Into<String>) -> Self
Add a string field.
Sourcepub fn object(self, key: impl Into<String>, factory: JsonObjectFactory) -> Self
pub fn object(self, key: impl Into<String>, factory: JsonObjectFactory) -> Self
Add a nested object field.
Sourcepub fn array(self, key: impl Into<String>, factory: JsonArrayFactory) -> Self
pub fn array(self, key: impl Into<String>, factory: JsonArrayFactory) -> Self
Add an array field.
Sourcepub fn build_value(self) -> Value
pub fn build_value(self) -> Value
Build as a serde_json::Value.
Trait Implementations§
Source§impl Clone for JsonObjectFactory
impl Clone for JsonObjectFactory
Source§fn clone(&self) -> JsonObjectFactory
fn clone(&self) -> JsonObjectFactory
Returns a duplicate 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 Debug for JsonObjectFactory
impl Debug for JsonObjectFactory
Source§impl Default for JsonObjectFactory
impl Default for JsonObjectFactory
Source§fn default() -> JsonObjectFactory
fn default() -> JsonObjectFactory
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for JsonObjectFactory
impl RefUnwindSafe for JsonObjectFactory
impl Send for JsonObjectFactory
impl Sync for JsonObjectFactory
impl Unpin for JsonObjectFactory
impl UnwindSafe for JsonObjectFactory
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§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, _span: NoopSpan) -> Self
fn instrument(self, _span: NoopSpan) -> Self
Instruments this future with a span (no-op when disabled).
Source§fn in_current_span(self) -> Self
fn in_current_span(self) -> Self
Instruments this future with the current span (no-op when disabled).