pub enum Val {
}Variants§
Bool(bool)
Float(f64)
Int8(i8)
Uint8(u8)
Int16(i16)
Uint16(u16)
Int32(i32)
Uint32(u32)
Int64(i64)
Uint64(u64)
Int128(i128)
UInt128(u128)
Bytes(Vec<u8>)
String(String)
Array(Vec<Val>)
Map(BTreeMap<String, Val>)
Implementations§
Source§impl Val
impl Val
pub fn from_bytes(bytes: &[u8]) -> Result<Val, String>
pub fn to_bytes(&self) -> Vec<u8> ⓘ
pub fn as_bool(&self) -> Option<bool>
pub fn as_float(&self) -> Option<f64>
pub fn as_i8(&self) -> Option<i8>
pub fn as_u8(&self) -> Option<u8>
pub fn as_i16(&self) -> Option<i16>
pub fn as_u16(&self) -> Option<u16>
pub fn as_i32(&self) -> Option<i32>
pub fn as_u32(&self) -> Option<u32>
pub fn as_i64(&self) -> Option<i64>
pub fn as_u64(&self) -> Option<u64>
pub fn as_i128(&self) -> Option<i128>
pub fn as_u128(&self) -> Option<u128>
pub fn as_string(&self) -> Option<String>
pub fn as_bytes(&self) -> Option<Vec<u8>>
pub fn as_array(&self) -> Option<Vec<Val>>
pub fn as_map(&self) -> Option<BTreeMap<String, Val>>
Trait Implementations§
impl StructuralPartialEq for Val
Auto Trait Implementations§
impl Freeze for Val
impl RefUnwindSafe for Val
impl Send for Val
impl Sync for Val
impl Unpin for Val
impl UnwindSafe for Val
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§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