pub struct Class(/* private fields */);Expand description
Objective-C class.
A class is a blueprint for creating objects. Classes are looked up by name from the runtime.
Implementations§
Source§impl Class
impl Class
Sourcepub fn get(name: &str) -> Option<Self>
pub fn get(name: &str) -> Option<Self>
Look up a class by name.
Returns None if the class is not registered with the runtime.
Sourcepub unsafe fn get_cstr(name: *const c_char) -> Option<Self>
pub unsafe fn get_cstr(name: *const c_char) -> Option<Self>
Look up a class from a null-terminated C string.
§Safety
The pointer must be a valid null-terminated C string.
Sourcepub fn instances_respond_to(&self, sel: Sel) -> bool
pub fn instances_respond_to(&self, sel: Sel) -> bool
Check if instances of this class respond to the given selector.
Returns true if the class has an instance method for the selector.
Sourcepub fn responds_to(&self, sel: Sel) -> bool
pub fn responds_to(&self, sel: Sel) -> bool
Check if this class responds to the given selector (class method).
Returns true if the class has a class method for the selector.
Trait Implementations§
impl Copy for Class
impl Eq for Class
impl Send for Class
impl StructuralPartialEq for Class
impl Sync for Class
Auto Trait Implementations§
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