pub struct Class { /* private fields */ }Expand description
A managed class (Il2CppClass*).
Implementations§
Source§impl Class
impl Class
Sourcepub fn name(&self) -> &'static str
pub fn name(&self) -> &'static str
The class’s simple name, e.g. PlayerHealth; nested classes give their own name only.
Sourcepub fn namespace(&self) -> &'static str
pub fn namespace(&self) -> &'static str
The class’s namespace, e.g. UnityEngine; empty for the global namespace.
Sourcepub fn method(&self, name: &str, parameter_count: i32) -> Result<Method>
pub fn method(&self, name: &str, parameter_count: i32) -> Result<Method>
Finds a method by name and parameter count (-1 for any).
Sourcepub fn new_object(&self) -> Object
pub fn new_object(&self) -> Object
Allocates an object of this class without running a constructor; call
.ctor on it with Method::call.
Sourcepub fn type_object(&self) -> Object
pub fn type_object(&self) -> Object
The class’s System.Type, as typeof gives it.
Sourcepub fn methods(&self) -> impl Iterator<Item = Method> + '_
pub fn methods(&self) -> impl Iterator<Item = Method> + '_
Every method declared by the class, e.g. to pick an overload by Method::signature.
Sourcepub fn field(&self, name: &str) -> Result<Field>
pub fn field(&self, name: &str) -> Result<Field>
A field by name, with its type, offset and whether it is static.
Sourcepub fn field_offset(&self, name: &str) -> Result<usize>
pub fn field_offset(&self, name: &str) -> Result<usize>
The byte offset of an instance field from the start of an object.
Trait Implementations§
impl Copy for Class
impl Send for Class
impl Sync for Class
Auto Trait Implementations§
impl Forget for Class
impl Freeze for Class
impl Move for Class
impl RefUnwindSafe for Class
impl Unpin for Class
impl UnsafeUnpin for Class
impl UnwindSafe for Class
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