pub enum UnityValue {
Null,
Bool(bool),
Integer(i64),
Float(f64),
String(String),
Array(Vec<UnityValue>),
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>)
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<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
Source§impl Display for UnityValue
impl Display for UnityValue
Source§impl From<&str> for UnityValue
impl From<&str> for UnityValue
Source§impl From<IndexMap<String, UnityValue>> for UnityValue
impl From<IndexMap<String, UnityValue>> for UnityValue
Source§impl From<String> for UnityValue
impl From<String> for UnityValue
Source§impl From<Vec<UnityValue>> for UnityValue
impl From<Vec<UnityValue>> for UnityValue
Source§fn from(arr: Vec<UnityValue>) -> Self
fn from(arr: Vec<UnityValue>) -> Self
Converts to this type from the input type.
Source§impl From<bool> for UnityValue
impl From<bool> for UnityValue
Source§impl From<f32> for UnityValue
impl From<f32> for UnityValue
Source§impl From<f64> for UnityValue
impl From<f64> for UnityValue
Source§impl From<i32> for UnityValue
impl From<i32> for UnityValue
Source§impl From<i64> for UnityValue
impl From<i64> for UnityValue
Source§impl PartialEq for UnityValue
impl PartialEq for UnityValue
Source§impl Serialize for UnityValue
impl Serialize for UnityValue
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