Enum ruma::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>
Available on crate feature events
only.
pub fn as_bool(&self) -> Option<bool>
events
only.If the FlattenedJsonValue
is a Bool
, return the inner value.
sourcepub fn as_integer(&self) -> Option<Int>
Available on crate feature events
only.
pub fn as_integer(&self) -> Option<Int>
events
only.If the FlattenedJsonValue
is an Integer
, return the inner value.
sourcepub fn as_str(&self) -> Option<&str>
Available on crate feature events
only.
pub fn as_str(&self) -> Option<&str>
events
only.If the FlattenedJsonValue
is a String
, return a reference to the inner value.
sourcepub fn as_array(&self) -> Option<&[ScalarJsonValue]>
Available on crate feature events
only.
pub fn as_array(&self) -> Option<&[ScalarJsonValue]>
events
only.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§fn from(value: &str) -> FlattenedJsonValue
fn from(value: &str) -> FlattenedJsonValue
Converts to this type from the input type.
source§impl From<Int> for FlattenedJsonValue
impl From<Int> for FlattenedJsonValue
source§fn from(value: Int) -> FlattenedJsonValue
fn from(value: Int) -> FlattenedJsonValue
Converts to this type from the input type.
source§impl From<String> for FlattenedJsonValue
impl From<String> for FlattenedJsonValue
source§fn from(value: String) -> FlattenedJsonValue
fn from(value: String) -> FlattenedJsonValue
Converts to this type from the input type.
source§impl From<Vec<ScalarJsonValue>> for FlattenedJsonValue
impl From<Vec<ScalarJsonValue>> for FlattenedJsonValue
source§fn from(value: Vec<ScalarJsonValue>) -> FlattenedJsonValue
fn from(value: Vec<ScalarJsonValue>) -> FlattenedJsonValue
Converts to this type from the input type.
source§impl From<bool> for FlattenedJsonValue
impl From<bool> for FlattenedJsonValue
source§fn from(value: bool) -> FlattenedJsonValue
fn from(value: bool) -> FlattenedJsonValue
Converts to this type from the input type.
source§impl PartialEq for FlattenedJsonValue
impl PartialEq for FlattenedJsonValue
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§unsafe fn clone_to_uninit(&self, dst: *mut T)
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.source§impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
source§impl<T> Identity for Twhere
T: ?Sized,
impl<T> Identity for Twhere
T: ?Sized,
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more