#[repr(C)]pub struct Class(_);
Expand description
A type that represents an Objective-C class.
Implementations
sourceimpl Class
impl Class
sourcepub fn get(name: &str) -> Option<&'static Self>
pub fn get(name: &str) -> Option<&'static Self>
Returns the class definition of a specified class, or None
if the
class is not registered with the Objective-C runtime.
sourcepub fn classes_count() -> usize
pub fn classes_count() -> usize
Returns the total number of registered classes.
sourcepub fn superclass(&self) -> Option<&Class>
pub fn superclass(&self) -> Option<&Class>
Returns the superclass of self, or None
if self is a root class.
sourcepub fn instance_size(&self) -> usize
pub fn instance_size(&self) -> usize
Returns the size of instances of self.
sourcepub fn instance_method(&self, sel: Sel) -> Option<&Method>
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.
sourcepub fn instance_variable(&self, name: &str) -> Option<&Ivar>
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.
sourcepub fn instance_methods(&self) -> Malloc<[&Method]>
pub fn instance_methods(&self) -> Malloc<[&Method]>
Describes the instance methods implemented by self.
sourcepub fn conforms_to(&self, proto: &Protocol) -> bool
pub fn conforms_to(&self, proto: &Protocol) -> bool
Checks whether this class conforms to the specified protocol.
Trait Implementations
sourceimpl<'a> MessageReceiver for &'a Class
impl<'a> MessageReceiver for &'a Class
sourceunsafe fn send_message<A, R>(self, sel: Sel, args: A) -> Result<R, MessageError> where
A: MessageArguments,
R: Encode,
unsafe fn send_message<A, R>(self, sel: Sel, args: A) -> Result<R, MessageError> where
A: MessageArguments,
R: Encode,
Sends a message to self with the given selector and arguments. Read more
sourceunsafe fn send_super_message<A, R>(
self,
superclass: &Class,
sel: Sel,
args: A
) -> Result<R, MessageError> where
A: MessageArguments,
R: Encode,
unsafe fn send_super_message<A, R>(
self,
superclass: &Class,
sel: Sel,
args: A
) -> Result<R, MessageError> where
A: MessageArguments,
R: Encode,
Sends a message to self’s superclass with the given selector and arguments. Read more
sourcefn verify_message<A, R>(self, sel: Sel) -> Result<(), MessageError> where
A: EncodeArguments,
R: Encode,
fn verify_message<A, R>(self, sel: Sel) -> Result<(), MessageError> where
A: EncodeArguments,
R: Encode,
Verify that the argument and return types match the encoding of the method for the given selector. Read more
sourceimpl RefEncode for Class
impl RefEncode for Class
sourceconst ENCODING_REF: Encoding<'static> = Encoding::Class
const ENCODING_REF: Encoding<'static> = Encoding::Class
The Objective-C type-encoding for a reference of this type. Read more
impl Eq for Class
impl RefUnwindSafe for Class
impl Send for Class
impl Sync for Class
impl UnwindSafe for Class
Auto Trait Implementations
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more