pub enum JsonValueNode {
Object(JsonObject),
Array(JsonArray),
String(JsonString),
Number(JsonNumber),
Boolean(JsonBoolean),
Null(JsonNull),
}Expand description
Represents any valid JSON value.
Variants§
Object(JsonObject)
A JSON object (collection of key-value pairs).
Array(JsonArray)
A JSON array (ordered list of values).
String(JsonString)
A JSON string.
Number(JsonNumber)
A JSON number (represented as f64).
Boolean(JsonBoolean)
A JSON boolean (true or false).
Null(JsonNull)
A JSON null value.
Implementations§
Source§impl JsonValueNode
impl JsonValueNode
Sourcepub fn as_array(&self) -> Option<&JsonArray>
pub fn as_array(&self) -> Option<&JsonArray>
Returns the value as a reference to a JsonArray, if it is an array.
Sourcepub fn as_object(&self) -> Option<&JsonObject>
pub fn as_object(&self) -> Option<&JsonObject>
Returns the value as a reference to a JsonObject, if it is an object.
Sourcepub fn get(&self, key: &str) -> Option<&JsonValueNode>
pub fn get(&self, key: &str) -> Option<&JsonValueNode>
Gets a value from the object by key, if this value is an object.
Trait Implementations§
Source§impl AsDocument for JsonValueNode
impl AsDocument for JsonValueNode
Source§impl Clone for JsonValueNode
impl Clone for JsonValueNode
Source§fn clone(&self) -> JsonValueNode
fn clone(&self) -> JsonValueNode
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 JsonValueNode
impl Debug for JsonValueNode
Source§impl<'de> Deserialize<'de> for JsonValueNode
impl<'de> Deserialize<'de> for JsonValueNode
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for JsonValueNode
impl Display for JsonValueNode
Source§impl From<&str> for JsonValueNode
impl From<&str> for JsonValueNode
Source§impl From<()> for JsonValueNode
impl From<()> for JsonValueNode
Source§impl From<HashMap<String, JsonValueNode>> for JsonValueNode
impl From<HashMap<String, JsonValueNode>> for JsonValueNode
Source§impl<T: Into<JsonValueNode>> From<Option<T>> for JsonValueNode
impl<T: Into<JsonValueNode>> From<Option<T>> for JsonValueNode
Source§impl From<String> for JsonValueNode
impl From<String> for JsonValueNode
Source§impl From<Vec<JsonValueNode>> for JsonValueNode
impl From<Vec<JsonValueNode>> for JsonValueNode
Source§fn from(elements: Vec<JsonValueNode>) -> Self
fn from(elements: Vec<JsonValueNode>) -> Self
Converts to this type from the input type.
Source§impl From<bool> for JsonValueNode
impl From<bool> for JsonValueNode
Source§impl From<f32> for JsonValueNode
impl From<f32> for JsonValueNode
Source§impl From<f64> for JsonValueNode
impl From<f64> for JsonValueNode
Source§impl From<i32> for JsonValueNode
impl From<i32> for JsonValueNode
Source§impl From<i64> for JsonValueNode
impl From<i64> for JsonValueNode
Source§impl From<u32> for JsonValueNode
impl From<u32> for JsonValueNode
Source§impl From<u64> for JsonValueNode
impl From<u64> for JsonValueNode
Source§impl From<usize> for JsonValueNode
impl From<usize> for JsonValueNode
Source§impl<T: Into<JsonValueNode>> FromIterator<T> for JsonValueNode
impl<T: Into<JsonValueNode>> FromIterator<T> for JsonValueNode
Source§fn from_iter<I: IntoIterator<Item = T>>(iter: I) -> Self
fn from_iter<I: IntoIterator<Item = T>>(iter: I) -> Self
Creates a value from an iterator. Read more
Source§impl PartialEq for JsonValueNode
impl PartialEq for JsonValueNode
Source§impl Serialize for JsonValueNode
impl Serialize for JsonValueNode
Source§impl ToSource for JsonValueNode
impl ToSource for JsonValueNode
Source§fn to_source(&self, buffer: &mut SourceBuffer)
fn to_source(&self, buffer: &mut SourceBuffer)
Writes the source code representation of this type to the provided buffer.
Source§fn to_source_string(&self) -> String
fn to_source_string(&self) -> String
Converts this type to a source code string.
impl StructuralPartialEq for JsonValueNode
Auto Trait Implementations§
impl Freeze for JsonValueNode
impl RefUnwindSafe for JsonValueNode
impl Send for JsonValueNode
impl Sync for JsonValueNode
impl Unpin for JsonValueNode
impl UnsafeUnpin for JsonValueNode
impl UnwindSafe for JsonValueNode
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