pub struct PythonLikeUnityClassMut<'a> { /* private fields */ }Expand description
Mutable Python-like wrapper for Unity classes
Implementations§
Source§impl<'a> PythonLikeUnityClassMut<'a>
impl<'a> PythonLikeUnityClassMut<'a>
Sourcepub fn new(class: &'a mut UnityClass) -> Self
pub fn new(class: &'a mut UnityClass) -> Self
Create a new mutable Python-like wrapper
Sourcepub fn set_string(&mut self, key: &str, value: &str) -> Result<()>
pub fn set_string(&mut self, key: &str, value: &str) -> Result<()>
Set a string property (Python-like: entry.m_Name = “value”)
Sourcepub fn set_integer(&mut self, key: &str, value: i64) -> Result<()>
pub fn set_integer(&mut self, key: &str, value: i64) -> Result<()>
Set an integer property (Python-like: entry.m_Health = 100)
Sourcepub fn set_dynamic(&mut self, key: &str, value: DynamicValue) -> Result<()>
pub fn set_dynamic(&mut self, key: &str, value: DynamicValue) -> Result<()>
Set a dynamic value
Sourcepub fn add_to_numeric(&mut self, key: &str, value: f64) -> Result<()>
pub fn add_to_numeric(&mut self, key: &str, value: f64) -> Result<()>
Add to numeric property (Python-like: entry.m_Health += 10)
Sourcepub fn concat_to_string(&mut self, key: &str, value: &str) -> Result<()>
pub fn concat_to_string(&mut self, key: &str, value: &str) -> Result<()>
Concatenate to string property (Python-like: entry.m_Text += “suffix”)
Sourcepub fn get_string(&self, key: &str) -> Option<String>
pub fn get_string(&self, key: &str) -> Option<String>
Get immutable access to properties
Sourcepub fn get_integer(&self, key: &str) -> Option<i64>
pub fn get_integer(&self, key: &str) -> Option<i64>
Get integer property
Sourcepub fn inner(&self) -> &UnityClass
pub fn inner(&self) -> &UnityClass
Get the underlying UnityClass
Sourcepub fn inner_mut(&mut self) -> &mut UnityClass
pub fn inner_mut(&mut self) -> &mut UnityClass
Get mutable access to the underlying UnityClass
Auto Trait Implementations§
impl<'a> Freeze for PythonLikeUnityClassMut<'a>
impl<'a> RefUnwindSafe for PythonLikeUnityClassMut<'a>
impl<'a> Send for PythonLikeUnityClassMut<'a>
impl<'a> Sync for PythonLikeUnityClassMut<'a>
impl<'a> Unpin for PythonLikeUnityClassMut<'a>
impl<'a> !UnwindSafe for PythonLikeUnityClassMut<'a>
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