pub struct UnityClass {
pub class_id: i32,
pub class_name: String,
pub anchor: String,
pub extra_anchor_data: String,
/* private fields */
}Expand description
A Unity class instance
Fields§
§class_id: i32Class ID (numeric identifier)
class_name: StringClass name (string identifier)
anchor: StringYAML anchor for this object
extra_anchor_data: StringExtra data after the anchor line
Implementations§
Source§impl UnityClass
impl UnityClass
Sourcepub fn new(class_id: i32, class_name: String, anchor: String) -> Self
pub fn new(class_id: i32, class_name: String, anchor: String) -> Self
Create a new Unity class instance
Sourcepub fn get(&self, key: &str) -> Option<&UnityValue>
pub fn get(&self, key: &str) -> Option<&UnityValue>
Get a property value
Sourcepub fn get_mut(&mut self, key: &str) -> Option<&mut UnityValue>
pub fn get_mut(&mut self, key: &str) -> Option<&mut UnityValue>
Get a mutable property value
Sourcepub fn set<V: Into<UnityValue>>(&mut self, key: String, value: V)
pub fn set<V: Into<UnityValue>>(&mut self, key: String, value: V)
Set a property value
Sourcepub fn has_property(&self, key: &str) -> bool
pub fn has_property(&self, key: &str) -> bool
Check if a property exists
Sourcepub fn property_names(&self) -> impl Iterator<Item = &String>
pub fn property_names(&self) -> impl Iterator<Item = &String>
Get all property names
Sourcepub fn properties(&self) -> &IndexMap<String, UnityValue>
pub fn properties(&self) -> &IndexMap<String, UnityValue>
Get all properties
Sourcepub fn properties_mut(&mut self) -> &mut IndexMap<String, UnityValue>
pub fn properties_mut(&mut self) -> &mut IndexMap<String, UnityValue>
Get mutable properties
Sourcepub fn update_properties(&mut self, other: IndexMap<String, UnityValue>)
pub fn update_properties(&mut self, other: IndexMap<String, UnityValue>)
Update properties from another map
Sourcepub fn serialized_properties(&self) -> IndexMap<String, UnityValue>
pub fn serialized_properties(&self) -> IndexMap<String, UnityValue>
Get serialized properties (excluding anchor and metadata)
Trait Implementations§
Source§impl Clone for UnityClass
impl Clone for UnityClass
Source§fn clone(&self) -> UnityClass
fn clone(&self) -> UnityClass
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 UnityClass
impl Debug for UnityClass
Source§impl Display for UnityClass
impl Display for UnityClass
Source§impl DynamicAccess for UnityClass
Implementation of dynamic property access for UnityClass
impl DynamicAccess for UnityClass
Implementation of dynamic property access for UnityClass
Source§fn get_dynamic(&self, key: &str) -> Option<DynamicValue>
fn get_dynamic(&self, key: &str) -> Option<DynamicValue>
Get a property value with automatic type conversion
Source§fn set_dynamic(&mut self, key: &str, value: DynamicValue) -> Result<()>
fn set_dynamic(&mut self, key: &str, value: DynamicValue) -> Result<()>
Set a property value with automatic type conversion
Source§fn has_dynamic(&self, key: &str) -> bool
fn has_dynamic(&self, key: &str) -> bool
Check if a property exists
Source§fn keys_dynamic(&self) -> Vec<String>
fn keys_dynamic(&self) -> Vec<String>
Get all property names
Auto Trait Implementations§
impl Freeze for UnityClass
impl RefUnwindSafe for UnityClass
impl Send for UnityClass
impl Sync for UnityClass
impl Unpin for UnityClass
impl UnwindSafe for UnityClass
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