pub enum TraitData {
String(String),
Number(f64),
Boolean(bool),
Object(HashMap<String, Value>),
Array(Vec<Value>),
Binary(Vec<u8>),
}Expand description
The actual data contained in a trait
Variants§
String(String)
Simple string value
Number(f64)
Numeric value
Boolean(bool)
Boolean value
Object(HashMap<String, Value>)
Complex structured data
Array(Vec<Value>)
Array of values
Binary(Vec<u8>)
Binary data
Implementations§
Source§impl TraitData
impl TraitData
Sourcepub fn is_boolean(&self) -> bool
pub fn is_boolean(&self) -> bool
Check if this trait data is a boolean
Sourcepub fn as_boolean(&self) -> Option<bool>
pub fn as_boolean(&self) -> Option<bool>
Try to get the boolean value
Trait Implementations§
Source§impl<'de> Deserialize<'de> for TraitData
impl<'de> Deserialize<'de> for TraitData
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
Auto Trait Implementations§
impl Freeze for TraitData
impl RefUnwindSafe for TraitData
impl Send for TraitData
impl Sync for TraitData
impl Unpin for TraitData
impl UnwindSafe for TraitData
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