pub struct Class { /* private fields */ }Expand description
A managed class (Il2CppClass*).
Implementations§
Source§impl Class
impl Class
pub fn as_ptr(&self) -> Ptr
pub fn name(&self) -> &'static str
pub fn namespace(&self) -> &'static str
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 Freeze 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