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: i32
Class ID (numeric identifier)
class_name: String
Class name (string identifier)
anchor: String
YAML anchor for this object
extra_anchor_data: String
Extra data after the anchor line
Implementations§
Source§impl UnityClass
impl UnityClass
Sourcepub fn new(class_id: i32, class_name: String, anchor: String) -> UnityClass
pub fn new(class_id: i32, class_name: String, anchor: String) -> UnityClass
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>(&mut self, key: String, value: V)where
V: Into<UnityValue>,
pub fn set<V>(&mut self, key: String, value: V)where
V: Into<UnityValue>,
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<(), UnityAssetError>
fn set_dynamic( &mut self, key: &str, value: DynamicValue, ) -> Result<(), UnityAssetError>
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
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