Enum ruma_common::push::FlattenedJsonValue
source · pub enum FlattenedJsonValue {
Null,
Bool(bool),
Integer(Int),
String(String),
Array(Vec<ScalarJsonValue>),
EmptyObject,
}
Expand description
Possible JSON values after an object is flattened.
Variants§
Null
Represents a null
value.
Bool(bool)
Represents a boolean.
Integer(Int)
Represents an integer.
String(String)
Represents a string.
Array(Vec<ScalarJsonValue>)
Represents an array.
EmptyObject
Represents an empty object.
Implementations§
source§impl FlattenedJsonValue
impl FlattenedJsonValue
sourcepub fn as_bool(&self) -> Option<bool>
pub fn as_bool(&self) -> Option<bool>
If the FlattenedJsonValue
is a Bool
, return the inner value.
sourcepub fn as_integer(&self) -> Option<Int>
pub fn as_integer(&self) -> Option<Int>
If the FlattenedJsonValue
is an Integer
, return the inner value.
sourcepub fn as_str(&self) -> Option<&str>
pub fn as_str(&self) -> Option<&str>
If the FlattenedJsonValue
is a String
, return a reference to the inner value.
sourcepub fn as_array(&self) -> Option<&[ScalarJsonValue]>
pub fn as_array(&self) -> Option<&[ScalarJsonValue]>
If the FlattenedJsonValue
is an Array
, return a reference to the inner value.
Trait Implementations§
source§impl Clone for FlattenedJsonValue
impl Clone for FlattenedJsonValue
source§fn clone(&self) -> FlattenedJsonValue
fn clone(&self) -> FlattenedJsonValue
Returns a copy 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 FlattenedJsonValue
impl Debug for FlattenedJsonValue
source§impl Default for FlattenedJsonValue
impl Default for FlattenedJsonValue
source§fn default() -> FlattenedJsonValue
fn default() -> FlattenedJsonValue
Returns the “default value” for a type. Read more
source§impl From<&str> for FlattenedJsonValue
impl From<&str> for FlattenedJsonValue
source§impl From<Int> for FlattenedJsonValue
impl From<Int> for FlattenedJsonValue
source§impl From<String> for FlattenedJsonValue
impl From<String> for FlattenedJsonValue
source§impl From<Vec<ScalarJsonValue>> for FlattenedJsonValue
impl From<Vec<ScalarJsonValue>> for FlattenedJsonValue
source§fn from(value: Vec<ScalarJsonValue>) -> Self
fn from(value: Vec<ScalarJsonValue>) -> Self
Converts to this type from the input type.
source§impl From<bool> for FlattenedJsonValue
impl From<bool> for FlattenedJsonValue
source§impl PartialEq<FlattenedJsonValue> for ScalarJsonValue
impl PartialEq<FlattenedJsonValue> for ScalarJsonValue
source§fn eq(&self, other: &FlattenedJsonValue) -> bool
fn eq(&self, other: &FlattenedJsonValue) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialEq<ScalarJsonValue> for FlattenedJsonValue
impl PartialEq<ScalarJsonValue> for FlattenedJsonValue
source§fn eq(&self, other: &ScalarJsonValue) -> bool
fn eq(&self, other: &ScalarJsonValue) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialEq for FlattenedJsonValue
impl PartialEq for FlattenedJsonValue
source§fn eq(&self, other: &FlattenedJsonValue) -> bool
fn eq(&self, other: &FlattenedJsonValue) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl Eq for FlattenedJsonValue
impl StructuralPartialEq for FlattenedJsonValue
Auto Trait Implementations§
impl Freeze for FlattenedJsonValue
impl RefUnwindSafe for FlattenedJsonValue
impl Send for FlattenedJsonValue
impl Sync for FlattenedJsonValue
impl Unpin for FlattenedJsonValue
impl UnwindSafe for FlattenedJsonValue
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§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.