Value

Enum Value 

Source
pub enum Value {
Show 14 variants I64(i64), I32(i32), I16(i16), I8(i8), U64(u64), U32(u32), U16(u16), U8(u8), F64(f64), String(String), Bytes(Vec<u8>), Bool(bool), Object(HashMap<String, Value>), Seq(Vec<Value>),
}

Variants§

§

I64(i64)

§

I32(i32)

§

I16(i16)

§

I8(i8)

§

U64(u64)

§

U32(u32)

§

U16(u16)

§

U8(u8)

§

F64(f64)

§

String(String)

§

Bytes(Vec<u8>)

§

Bool(bool)

§

Object(HashMap<String, Value>)

§

Seq(Vec<Value>)

Implementations§

Source§

impl Value

Source

pub fn get(&self, key: &str) -> Option<&Value>

Source

pub fn get_mut(&mut self, key: &str) -> Option<&mut Value>

Source

pub fn get_value_type_as_unexpected(&self) -> Unexpected<'_>

Source

pub fn get_i64(&self) -> Option<&i64>

Source

pub fn get_i32(&self) -> Option<&i32>

Source

pub fn get_i16(&self) -> Option<&i16>

Source

pub fn get_i8(&self) -> Option<&i8>

Source

pub fn get_u64(&self) -> Option<&u64>

Source

pub fn get_u32(&self) -> Option<&u32>

Source

pub fn get_u16(&self) -> Option<&u16>

Source

pub fn get_u8(&self) -> Option<&u8>

Source

pub fn get_f64(&self) -> Option<&f64>

Source

pub fn get_string(&self) -> Option<&String>

Source

pub fn get_bytes(&self) -> Option<&Vec<u8>>

Source

pub fn get_bool(&self) -> Option<&bool>

Source

pub fn get_raw_hashmap(&self) -> Option<&HashMap<String, Value>>

Source

pub fn get_seq(&self) -> Option<&Vec<Value>>

Source

pub fn is_i64(&self) -> bool

Source

pub fn is_i32(&self) -> bool

Source

pub fn is_i16(&self) -> bool

Source

pub fn is_i8(&self) -> bool

Source

pub fn is_u64(&self) -> bool

Source

pub fn is_u32(&self) -> bool

Source

pub fn is_u16(&self) -> bool

Source

pub fn is_u8(&self) -> bool

Source

pub fn is_f64(&self) -> bool

Source

pub fn is_string(&self) -> bool

Source

pub fn is_bytes(&self) -> bool

Source

pub fn is_bool(&self) -> bool

Source

pub fn is_object(&self) -> bool

Source

pub fn is_seq(&self) -> bool

Trait Implementations§

Source§

impl Debug for Value

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for Value

Source§

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 Serialize for Value

Source§

fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

§

impl Freeze for Value

§

impl RefUnwindSafe for Value

§

impl Send for Value

§

impl Sync for Value

§

impl Unpin for Value

§

impl UnwindSafe for Value

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,