Struct red4ext_rs::types::Class

source ·
pub struct Class(/* private fields */);
Expand description

An RTTI representation of a class.

Implementations§

source§

impl Class

source

pub fn name(&self) -> CName

source

pub fn flags(&self) -> ClassFlags

source

pub fn set_flags(&mut self, flags: ClassFlags)

source

pub fn size(&self) -> u32

source

pub fn holder_size(&self) -> u32

source

pub fn alignment(&self) -> u32

source

pub fn properties_size(&self) -> u32

source

pub fn properties(&self) -> &RedArray<&Property>

source

pub fn cached_properties(&self) -> &RedArray<&Property>

source

pub fn methods(&self) -> &RedArray<&Method>

source

pub fn method_map(&self) -> &RedHashMap<CName, &Method>

source

pub fn static_methods(&self) -> &RedArray<&StaticMethod>

source

pub fn get_method( &self, name: CName, ) -> Result<&Method, impl Iterator<Item = &Method>>

Resolves a method by name. Returns the method wrapped in Ok if it exists in this class or any of its base classes. If the method is not found, this function returns an iterator over all methods with a matching short name wrapped in Err.

source

pub fn base(&self) -> Option<&Class>

source

pub fn base_iter(&self) -> impl Iterator<Item = &Class>

source

pub fn all_properties(&self) -> impl Iterator<Item = &Property>

source

pub fn is_class(&self) -> bool

source

pub fn instantiate(&self) -> ValueContainer

source

pub fn add_method(&mut self, func: PoolRef<Method>)

source

pub fn add_static_method(&mut self, func: PoolRef<StaticMethod>)

source

pub fn add_property(&mut self, prop: PoolRef<Property>)

source

pub fn as_type(&self) -> &Type

source

pub fn as_type_mut(&mut self) -> &mut Type

Trait Implementations§

source§

impl Debug for Class

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Drop for Class

source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

§

impl Freeze for Class

§

impl !RefUnwindSafe for Class

§

impl !Send for Class

§

impl !Sync for Class

§

impl Unpin for Class

§

impl !UnwindSafe for Class

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.