pub enum Value {
String(String),
Int(i64),
Float(f64),
Bool(bool),
Null,
Array(Vec<Value>),
Object(HashMap<String, Value>),
Secret(String),
}Expand description
SYNX value types.
Variants§
String(String)
Int(i64)
Float(f64)
Bool(bool)
Null
Array(Vec<Value>)
Object(HashMap<String, Value>)
Secret(String)
Secret value — displays as [SECRET], real value accessible via as_secret()
Implementations§
Source§impl Value
impl Value
pub fn as_str(&self) -> Option<&str>
pub fn as_int(&self) -> Option<i64>
pub fn as_float(&self) -> Option<f64>
pub fn as_bool(&self) -> Option<bool>
pub fn as_object(&self) -> Option<&HashMap<String, Value>>
pub fn as_object_mut(&mut self) -> Option<&mut HashMap<String, Value>>
pub fn as_array(&self) -> Option<&Vec<Value>>
pub fn as_array_mut(&mut self) -> Option<&mut Vec<Value>>
pub fn as_secret(&self) -> Option<&str>
pub fn is_null(&self) -> bool
pub fn as_number_f64(&self) -> Option<f64>
Trait Implementations§
impl StructuralPartialEq for Value
Auto Trait Implementations§
impl Freeze for Value
impl RefUnwindSafe for Value
impl Send for Value
impl Sync for Value
impl Unpin for Value
impl UnsafeUnpin for Value
impl UnwindSafe for Value
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