Struct objc::runtime::Class

source ·
#[repr(C)]
pub struct Class { /* private fields */ }
Expand description

A type that represents an Objective-C class.

Implementations§

source§

impl Class

source

pub fn get(name: &str) -> Option<&'static Class>

Returns the class definition of a specified class, or None if the class is not registered with the Objective-C runtime.

source

pub fn classes() -> MallocBuffer<&'static Class>

Obtains the list of registered class definitions.

source

pub fn classes_count() -> usize

Returns the total number of registered classes.

source

pub fn name(&self) -> &str

Returns the name of self.

source

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

Returns the superclass of self, or None if self is a root class.

source

pub fn metaclass(&self) -> &Class

Returns the metaclass of self.

source

pub fn instance_size(&self) -> usize

Returns the size of instances of self.

source

pub fn instance_method(&self, sel: Sel) -> Option<&Method>

Returns a specified instance method for self, or None if self and its superclasses do not contain an instance method with the specified selector.

source

pub fn instance_variable(&self, name: &str) -> Option<&Ivar>

Returns the ivar for a specified instance variable of self, or None if self has no ivar with the given name.

source

pub fn instance_methods(&self) -> MallocBuffer<&Method>

Describes the instance methods implemented by self.

source

pub fn conforms_to(&self, proto: &Protocol) -> bool

Checks whether this class conforms to the specified protocol.

source

pub fn adopted_protocols(&self) -> MallocBuffer<&Protocol>

Get a list of the protocols to which this class conforms.

source

pub fn instance_variables(&self) -> MallocBuffer<&Ivar>

Describes the instance variables declared by self.

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<'a> Encode for &'a Class

source§

fn encode() -> Encoding

Returns the Objective-C type encoding for Self.
source§

impl<'a> Encode for &'a mut Class

source§

fn encode() -> Encoding

Returns the Objective-C type encoding for Self.
source§

impl Message for Class

source§

unsafe fn send_message<A, R>( &self, sel: Sel, args: A ) -> Result<R, MessageError>where Self: Sized, A: MessageArguments, R: Any,

Sends a message to self with the given selector and arguments. Read more
source§

fn verify_message<A, R>(&self, sel: Sel) -> Result<(), MessageError>where Self: Sized, A: EncodeArguments, R: Encode,

Verifies that the argument and return types match the encoding of the method for the given selector. Read more
source§

impl PartialEq<Class> for Class

source§

fn eq(&self, other: &Class) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Eq for Class

Auto Trait Implementations§

§

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 Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere 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 Twhere 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 Twhere 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 Twhere 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.