pub enum UnityValue {
Null,
Bool(bool),
Integer(i64),
Float(f64),
String(String),
Array(Vec<UnityValue>),
Bytes(Vec<u8>),
Object(IndexMap<String, UnityValue>),
}Expand description
A Unity value that can be stored in a Unity class
Variants§
Null
Bool(bool)
Integer(i64)
Float(f64)
String(String)
Array(Vec<UnityValue>)
Bytes(Vec<u8>)
Object(IndexMap<String, UnityValue>)
Implementations§
Source§impl UnityValue
impl UnityValue
Sourcepub fn as_array(&self) -> Option<&Vec<UnityValue>>
pub fn as_array(&self) -> Option<&Vec<UnityValue>>
Get as array
Sourcepub fn as_object_mut(&mut self) -> Option<&mut IndexMap<String, UnityValue>>
pub fn as_object_mut(&mut self) -> Option<&mut IndexMap<String, UnityValue>>
Get mutable reference as object
Trait Implementations§
Source§impl Clone for UnityValue
impl Clone for UnityValue
Source§fn clone(&self) -> UnityValue
fn clone(&self) -> UnityValue
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for UnityValue
impl Debug for UnityValue
Source§impl<'de> Deserialize<'de> for UnityValue
impl<'de> Deserialize<'de> for UnityValue
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<UnityValue, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<UnityValue, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for UnityValue
impl Display for UnityValue
Source§impl From<&str> for UnityValue
impl From<&str> for UnityValue
Source§fn from(s: &str) -> UnityValue
fn from(s: &str) -> UnityValue
Converts to this type from the input type.
Source§impl From<IndexMap<String, UnityValue>> for UnityValue
impl From<IndexMap<String, UnityValue>> for UnityValue
Source§fn from(obj: IndexMap<String, UnityValue>) -> UnityValue
fn from(obj: IndexMap<String, UnityValue>) -> UnityValue
Converts to this type from the input type.
Source§impl From<String> for UnityValue
impl From<String> for UnityValue
Source§fn from(s: String) -> UnityValue
fn from(s: String) -> UnityValue
Converts to this type from the input type.
Source§impl From<Vec<UnityValue>> for UnityValue
impl From<Vec<UnityValue>> for UnityValue
Source§fn from(arr: Vec<UnityValue>) -> UnityValue
fn from(arr: Vec<UnityValue>) -> UnityValue
Converts to this type from the input type.
Source§impl From<bool> for UnityValue
impl From<bool> for UnityValue
Source§fn from(b: bool) -> UnityValue
fn from(b: bool) -> UnityValue
Converts to this type from the input type.
Source§impl From<f32> for UnityValue
impl From<f32> for UnityValue
Source§fn from(f: f32) -> UnityValue
fn from(f: f32) -> UnityValue
Converts to this type from the input type.
Source§impl From<f64> for UnityValue
impl From<f64> for UnityValue
Source§fn from(f: f64) -> UnityValue
fn from(f: f64) -> UnityValue
Converts to this type from the input type.
Source§impl From<i32> for UnityValue
impl From<i32> for UnityValue
Source§fn from(i: i32) -> UnityValue
fn from(i: i32) -> UnityValue
Converts to this type from the input type.
Source§impl From<i64> for UnityValue
impl From<i64> for UnityValue
Source§fn from(i: i64) -> UnityValue
fn from(i: i64) -> UnityValue
Converts to this type from the input type.
Source§impl PartialEq for UnityValue
impl PartialEq for UnityValue
Source§impl Serialize for UnityValue
impl Serialize for UnityValue
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl StructuralPartialEq for UnityValue
Auto Trait Implementations§
impl Freeze for UnityValue
impl RefUnwindSafe for UnityValue
impl Send for UnityValue
impl Sync for UnityValue
impl Unpin for UnityValue
impl UnwindSafe for UnityValue
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