pub enum StateValue {
String(String),
Integer(i64),
Float(f64),
Boolean(bool),
Array(Vec<StateValue>),
Object(HashMap<String, StateValue>),
Null,
Bytes(Vec<u8>),
}Expand description
Values that can be stored in the graph state
Variants§
String(String)
String value
Integer(i64)
Integer value
Float(f64)
Float value
Boolean(bool)
Boolean value
Array(Vec<StateValue>)
Array of values
Object(HashMap<String, StateValue>)
Object/Map of values
Null
Null value
Bytes(Vec<u8>)
Binary data
Implementations§
Source§impl StateValue
impl StateValue
Sourcepub fn as_integer(&self) -> Option<i64>
pub fn as_integer(&self) -> Option<i64>
Convert to integer if possible
Sourcepub fn as_boolean(&self) -> Option<bool>
pub fn as_boolean(&self) -> Option<bool>
Convert to boolean if possible
Sourcepub fn as_array(&self) -> Option<&Vec<StateValue>>
pub fn as_array(&self) -> Option<&Vec<StateValue>>
Convert to array if possible
Trait Implementations§
Source§impl Clone for StateValue
impl Clone for StateValue
Source§fn clone(&self) -> StateValue
fn clone(&self) -> StateValue
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 StateValue
impl Debug for StateValue
Source§impl<'de> Deserialize<'de> for StateValue
impl<'de> Deserialize<'de> for StateValue
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 From<&str> for StateValue
impl From<&str> for StateValue
Source§impl From<HashMap<String, StateValue>> for StateValue
impl From<HashMap<String, StateValue>> for StateValue
Source§impl From<StateValue> for Value
Available on crate feature serde only.
impl From<StateValue> for Value
Available on crate feature
serde only.Source§fn from(value: StateValue) -> Self
fn from(value: StateValue) -> Self
Converts to this type from the input type.
Source§impl From<String> for StateValue
impl From<String> for StateValue
Source§impl From<Value> for StateValue
Available on crate feature serde only.
impl From<Value> for StateValue
Available on crate feature
serde only.Source§impl From<Vec<StateValue>> for StateValue
impl From<Vec<StateValue>> for StateValue
Source§fn from(arr: Vec<StateValue>) -> Self
fn from(arr: Vec<StateValue>) -> Self
Converts to this type from the input type.
Source§impl From<bool> for StateValue
impl From<bool> for StateValue
Source§impl From<f32> for StateValue
impl From<f32> for StateValue
Source§impl From<f64> for StateValue
impl From<f64> for StateValue
Source§impl From<i32> for StateValue
impl From<i32> for StateValue
Source§impl From<i64> for StateValue
impl From<i64> for StateValue
Source§impl PartialEq for StateValue
impl PartialEq for StateValue
Source§impl Serialize for StateValue
impl Serialize for StateValue
Source§impl TryFrom<StateValue> for String
impl TryFrom<StateValue> for String
Source§type Error = RGraphError
type Error = RGraphError
The type returned in the event of a conversion error.
Source§impl TryFrom<StateValue> for Vec<StateValue>
impl TryFrom<StateValue> for Vec<StateValue>
Source§type Error = RGraphError
type Error = RGraphError
The type returned in the event of a conversion error.
Source§impl TryFrom<StateValue> for bool
impl TryFrom<StateValue> for bool
Source§type Error = RGraphError
type Error = RGraphError
The type returned in the event of a conversion error.
Source§impl TryFrom<StateValue> for f64
impl TryFrom<StateValue> for f64
Source§type Error = RGraphError
type Error = RGraphError
The type returned in the event of a conversion error.
Source§impl TryFrom<StateValue> for i64
impl TryFrom<StateValue> for i64
Source§type Error = RGraphError
type Error = RGraphError
The type returned in the event of a conversion error.
impl StructuralPartialEq for StateValue
Auto Trait Implementations§
impl Freeze for StateValue
impl RefUnwindSafe for StateValue
impl Send for StateValue
impl Sync for StateValue
impl Unpin for StateValue
impl UnwindSafe for StateValue
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