pub enum CopperlaceValue {
Object(BTreeMap<String, CopperlaceValue>),
Array(Vec<CopperlaceValue>),
String(String),
Number(CopperlaceNumber),
Boolean(bool),
Null,
}Expand description
Native Copperlace structured render result.
Variants§
Object(BTreeMap<String, CopperlaceValue>)
Object entries keyed by field name.
Array(Vec<CopperlaceValue>)
Array entries in render order.
String(String)
String scalar.
Number(CopperlaceNumber)
Numeric scalar.
Boolean(bool)
Boolean scalar.
Null
Null scalar.
Implementations§
Source§impl CopperlaceValue
impl CopperlaceValue
Sourcepub fn into_json_value(self) -> Value
pub fn into_json_value(self) -> Value
Converts this value into a JSON value.
Sourcepub fn to_json_value(&self) -> Value
pub fn to_json_value(&self) -> Value
Converts this value into a JSON value without consuming it.
Sourcepub fn to_compact_json(&self) -> Result<String, RenderError>
pub fn to_compact_json(&self) -> Result<String, RenderError>
Serializes this value as compact JSON.
Sourcepub fn to_formatted_json(&self) -> Result<String, RenderError>
pub fn to_formatted_json(&self) -> Result<String, RenderError>
Serializes this value as formatted JSON using tabs for indentation.
Trait Implementations§
Source§impl Clone for CopperlaceValue
impl Clone for CopperlaceValue
Source§fn clone(&self) -> CopperlaceValue
fn clone(&self) -> CopperlaceValue
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 CopperlaceValue
impl Debug for CopperlaceValue
Source§impl PartialEq for CopperlaceValue
impl PartialEq for CopperlaceValue
impl StructuralPartialEq for CopperlaceValue
Auto Trait Implementations§
impl Freeze for CopperlaceValue
impl RefUnwindSafe for CopperlaceValue
impl Send for CopperlaceValue
impl Sync for CopperlaceValue
impl Unpin for CopperlaceValue
impl UnsafeUnpin for CopperlaceValue
impl UnwindSafe for CopperlaceValue
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