pub struct ClassBuilder { /* private fields */ }Expand description
A class being built. Add methods, then register.
Implementations§
Source§impl ClassBuilder
impl ClassBuilder
Sourcepub unsafe fn new(superclass: &CStr, name: &CStr) -> Option<Self>
pub unsafe fn new(superclass: &CStr, name: &CStr) -> Option<Self>
Begin a new class, or return None if the name is already taken.
§Safety
superclass must name a registered class.
Sourcepub unsafe fn method(
self,
selector: &CStr,
imp: *const c_void,
types: &CStr,
) -> Self
pub unsafe fn method( self, selector: &CStr, imp: *const c_void, types: &CStr, ) -> Self
Add a method.
types is an Objective-C type encoding: return type, then @: for the
implicit receiver and selector, then one code per argument. B@:@@ is
“returns BOOL, takes two objects”.
§Safety
imp’s signature must match types, receiver and selector included.
Auto Trait Implementations§
impl !Send for ClassBuilder
impl !Sync for ClassBuilder
impl Freeze for ClassBuilder
impl RefUnwindSafe for ClassBuilder
impl Unpin for ClassBuilder
impl UnsafeUnpin for ClassBuilder
impl UnwindSafe for ClassBuilder
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