Enum wfrs_model::json::JsonValue
source · pub enum JsonValue {
Null,
Bool(bool),
Number(JsonNumber),
String(String),
Array(Vec<JsonValue>),
Object(HashMap<String, JsonValue>),
}Variants§
Null
Bool(bool)
Number(JsonNumber)
String(String)
Array(Vec<JsonValue>)
Object(HashMap<String, JsonValue>)
Implementations§
source§impl JsonValue
impl JsonValue
pub fn map() -> Self
pub fn is_null(&self) -> bool
pub fn is_object(&self) -> bool
pub fn as_object(&self) -> Option<&HashMap<String, JsonValue>>
pub fn is_array(&self) -> bool
pub fn as_array(&self) -> Option<&[JsonValue]>
pub fn as_bool(&self) -> Option<bool>
pub fn as_number(&self) -> Option<&JsonNumber>
pub fn as_str(&self) -> Option<&str>
pub fn as_f64(&self) -> Option<f64>
pub fn as_i64(&self) -> Option<i64>
pub fn as_u64(&self) -> Option<u64>
pub fn as_object_mut(&mut self) -> Option<&mut HashMap<String, JsonValue>>
Trait Implementations§
source§impl Archive for JsonValue
impl Archive for JsonValue
§type Archived = ArchivedJsonValue
type Archived = ArchivedJsonValue
The archived representation of this type. Read more
§type Resolver = JsonValueResolver
type Resolver = JsonValueResolver
The resolver for this type. It must contain all the additional information from serializing
needed to make the archived type from the normal type.
source§impl<__D> Deserialize<JsonValue, __D> for Archived<JsonValue>where
__D: SharedDeserializeRegistry + Fallible + ?Sized,
bool: Archive,
Archived<bool>: Deserialize<bool, __D>,
JsonNumber: Archive,
Archived<JsonNumber>: Deserialize<JsonNumber, __D>,
String: Archive,
Archived<String>: Deserialize<String, __D>,
impl<__D> Deserialize<JsonValue, __D> for Archived<JsonValue>where
__D: SharedDeserializeRegistry + Fallible + ?Sized,
bool: Archive,
Archived<bool>: Deserialize<bool, __D>,
JsonNumber: Archive,
Archived<JsonNumber>: Deserialize<JsonNumber, __D>,
String: Archive,
Archived<String>: Deserialize<String, __D>,
source§impl PartialEq<JsonValue> for ArchivedJsonValue
impl PartialEq<JsonValue> for ArchivedJsonValue
source§impl PartialEq for JsonValue
impl PartialEq for JsonValue
source§impl<__S> Serialize<__S> for JsonValuewhere
__S: ScratchSpace + SharedSerializeRegistry + Serializer + Fallible + ?Sized,
bool: Serialize<__S>,
JsonNumber: Serialize<__S>,
String: Serialize<__S>,
impl<__S> Serialize<__S> for JsonValuewhere
__S: ScratchSpace + SharedSerializeRegistry + Serializer + Fallible + ?Sized,
bool: Serialize<__S>,
JsonNumber: Serialize<__S>,
String: Serialize<__S>,
impl StructuralPartialEq for JsonValue
Auto Trait Implementations§
impl RefUnwindSafe for JsonValue
impl Send for JsonValue
impl Sync for JsonValue
impl Unpin for JsonValue
impl UnwindSafe for JsonValue
Blanket Implementations§
source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
§type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata ) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
source§impl<T> ArchiveUnsized for Twhere
T: Archive,
impl<T> ArchiveUnsized for Twhere
T: Archive,
§type Archived = <T as Archive>::Archived
type Archived = <T as Archive>::Archived
The archived counterpart of this type. Unlike
Archive, it may be unsized. Read more§type MetadataResolver = ()
type MetadataResolver = ()
The resolver for the metadata of this type. Read more
source§unsafe fn resolve_metadata(
&self,
_: usize,
_: <T as ArchiveUnsized>::MetadataResolver,
_: *mut <<T as ArchiveUnsized>::Archived as ArchivePointee>::ArchivedMetadata
)
unsafe fn resolve_metadata( &self, _: usize, _: <T as ArchiveUnsized>::MetadataResolver, _: *mut <<T as ArchiveUnsized>::Archived as ArchivePointee>::ArchivedMetadata )
Creates the archived version of the metadata for this value at the given position and writes
it to the given output. Read more
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<F, W, T, D> Deserialize<With<T, W>, D> for F
impl<F, W, T, D> Deserialize<With<T, W>, D> for F
source§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Gets the layout of the type.