pub enum Variant {
}
Variants§
None
Bool(bool)
Int8(i8)
UInt8(u8)
Int16(i16)
UInt16(u16)
Int32(i32)
UInt32(u32)
Int64(i64)
UInt64(u64)
Float(f32)
Double(f64)
String(String)
Buffer(Vec<u8>)
Array(Vec<Variant>)
Dict(HashMap<String, Variant>)
Implementations§
Source§impl Variant
impl Variant
pub fn new() -> Self
pub fn new_array() -> Self
pub fn new_dict() -> Variant
pub fn len(&self) -> usize
pub fn clear(&mut self)
pub fn concat(&mut self, other: &Self) -> bool
pub fn is_empty(&self) -> bool
pub fn is_number(&self) -> bool
pub fn set<T: Into<Self>>(&mut self, value: T)
pub fn get<T: From<Self>>(&self) -> T
pub fn get_number<T>(&self) -> Option<T>where
T: FromPrimitive,
pub fn array_add(&mut self, value: Variant)
pub fn array_get(&self, index: usize) -> Option<Variant>
pub fn array_set(&mut self, index: usize, value: Variant)
pub fn array_remove(&mut self, index: usize) -> bool
pub fn dict_get(&self, key: &str) -> Option<Variant>
pub fn dict_set(&mut self, key: &str, value: Variant)
pub fn dict_remove(&mut self, key: &str) -> bool
pub fn dict_contains(&self, key: &str) -> bool
pub fn array_iter(&self) -> Option<impl Iterator<Item = &Variant> + '_>
pub fn array_iter_mut( &mut self, ) -> Option<impl Iterator<Item = &mut Variant> + '_>
pub fn dict_iter( &self, ) -> Option<impl Iterator<Item = (&String, &Variant)> + '_>
pub fn dict_iter_mut( &mut self, ) -> Option<impl Iterator<Item = (&String, &mut Variant)> + '_>
pub fn get_bool(&self) -> Option<bool>
pub fn get_string(&self) -> Option<String>
pub fn get_buffer(&self) -> Option<Vec<u8>>
pub fn get_int8(&self) -> Option<i8>
pub fn get_uint8(&self) -> Option<u8>
pub fn get_int16(&self) -> Option<i16>
pub fn get_uint16(&self) -> Option<u16>
pub fn get_int32(&self) -> Option<i32>
pub fn get_uint32(&self) -> Option<u32>
pub fn get_int64(&self) -> Option<i64>
pub fn get_uint64(&self) -> Option<u64>
pub fn get_float(&self) -> Option<f32>
pub fn get_double(&self) -> Option<f64>
pub fn set_bool(&mut self, value: bool)
pub fn array_add_bool(&mut self, value: bool)
pub fn array_get_bool(&self, index: usize) -> Option<bool>
pub fn array_set_bool(&mut self, index: usize, value: bool)
pub fn dict_get_bool(&self, key: &str) -> Option<bool>
pub fn dict_set_bool(&mut self, key: &str, value: bool)
pub fn set_int8(&mut self, value: i8)
pub fn array_add_int8(&mut self, value: i8)
pub fn array_get_int8(&self, index: usize) -> Option<i8>
pub fn array_set_int8(&mut self, index: usize, value: i8)
pub fn dict_get_int8(&self, key: &str) -> Option<i8>
pub fn dict_set_int8(&mut self, key: &str, value: i8)
pub fn set_uint8(&mut self, value: u8)
pub fn array_add_uint8(&mut self, value: u8)
pub fn array_get_uint8(&self, index: usize) -> Option<u8>
pub fn array_set_uint8(&mut self, index: usize, value: u8)
pub fn dict_get_uint8(&self, key: &str) -> Option<u8>
pub fn dict_set_uint8(&mut self, key: &str, value: u8)
pub fn set_int16(&mut self, value: i16)
pub fn array_add_int16(&mut self, value: i16)
pub fn array_get_int16(&self, index: usize) -> Option<i16>
pub fn array_set_int16(&mut self, index: usize, value: i16)
pub fn dict_get_int16(&self, key: &str) -> Option<i16>
pub fn dict_set_int16(&mut self, key: &str, value: i16)
pub fn set_uint16(&mut self, value: u16)
pub fn array_add_uint16(&mut self, value: u16)
pub fn array_get_uint16(&self, index: usize) -> Option<u16>
pub fn array_set_uint16(&mut self, index: usize, value: u16)
pub fn dict_get_uint16(&self, key: &str) -> Option<u16>
pub fn dict_set_uint16(&mut self, key: &str, value: u16)
pub fn set_int32(&mut self, value: i32)
pub fn array_add_int32(&mut self, value: i32)
pub fn array_get_int32(&self, index: usize) -> Option<i32>
pub fn array_set_int32(&mut self, index: usize, value: i32)
pub fn dict_get_int32(&self, key: &str) -> Option<i32>
pub fn dict_set_int32(&mut self, key: &str, value: i32)
pub fn set_uint32(&mut self, value: u32)
pub fn array_add_uint32(&mut self, value: u32)
pub fn array_get_uint32(&self, index: usize) -> Option<u32>
pub fn array_set_uint32(&mut self, index: usize, value: u32)
pub fn dict_get_uint32(&self, key: &str) -> Option<u32>
pub fn dict_set_uint32(&mut self, key: &str, value: u32)
pub fn set_int64(&mut self, value: i64)
pub fn array_add_int64(&mut self, value: i64)
pub fn array_get_int64(&self, index: usize) -> Option<i64>
pub fn array_set_int64(&mut self, index: usize, value: i64)
pub fn dict_get_int64(&self, key: &str) -> Option<i64>
pub fn dict_set_int64(&mut self, key: &str, value: i64)
pub fn set_uint64(&mut self, value: u64)
pub fn array_add_uint64(&mut self, value: u64)
pub fn array_get_uint64(&self, index: usize) -> Option<u64>
pub fn array_set_uint64(&mut self, index: usize, value: u64)
pub fn dict_get_uint64(&self, key: &str) -> Option<u64>
pub fn dict_set_uint64(&mut self, key: &str, value: u64)
pub fn set_float(&mut self, value: f32)
pub fn array_add_float(&mut self, value: f32)
pub fn array_get_float(&self, index: usize) -> Option<f32>
pub fn array_set_float(&mut self, index: usize, value: f32)
pub fn dict_get_float(&self, key: &str) -> Option<f32>
pub fn dict_set_float(&mut self, key: &str, value: f32)
pub fn set_double(&mut self, value: f64)
pub fn array_add_double(&mut self, value: f64)
pub fn array_get_double(&self, index: usize) -> Option<f64>
pub fn array_set_double(&mut self, index: usize, value: f64)
pub fn dict_get_double(&self, key: &str) -> Option<f64>
pub fn dict_set_double(&mut self, key: &str, value: f64)
pub fn set_string(&mut self, value: String)
pub fn array_add_string(&mut self, value: String)
pub fn array_get_string(&self, index: usize) -> Option<String>
pub fn array_set_string(&mut self, index: usize, value: String)
pub fn dict_get_string(&self, key: &str) -> Option<String>
pub fn dict_set_string(&mut self, key: &str, value: String)
pub fn set_buffer(&mut self, value: Vec<u8>)
pub fn array_add_buffer(&mut self, value: Vec<u8>)
pub fn array_get_buffer(&self, index: usize) -> Option<Vec<u8>>
pub fn array_set_buffer(&mut self, index: usize, value: Vec<u8>)
pub fn dict_get_buffer(&self, key: &str) -> Option<Vec<u8>>
pub fn dict_set_buffer(&mut self, key: &str, value: Vec<u8>)
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Variant
impl<'de> Deserialize<'de> for Variant
Source§fn deserialize<D>(deserializer: D) -> Result<Variant, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Variant, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl FromIterator<Variant> for Variant
impl FromIterator<Variant> for Variant
impl StructuralPartialEq for Variant
Auto Trait Implementations§
impl Freeze for Variant
impl RefUnwindSafe for Variant
impl Send for Variant
impl Sync for Variant
impl Unpin for Variant
impl UnwindSafe for Variant
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