pub struct Protocol(/* private fields */);Expand description
Objective-C protocol.
A protocol defines a set of methods that a class can implement.
Implementations§
Source§impl Protocol
impl Protocol
Sourcepub fn get(name: &str) -> Option<Self>
pub fn get(name: &str) -> Option<Self>
Look up a protocol by name.
Returns None if the protocol is not registered with the runtime.
Sourcepub fn has_instance_method(&self, sel: Sel) -> bool
pub fn has_instance_method(&self, sel: Sel) -> bool
Check if this protocol declares an instance method with the given selector.
Checks both required and optional methods.
Sourcepub fn has_class_method(&self, sel: Sel) -> bool
pub fn has_class_method(&self, sel: Sel) -> bool
Check if this protocol declares a class method with the given selector.
Checks both required and optional methods.
Trait Implementations§
impl Copy for Protocol
impl Eq for Protocol
impl Send for Protocol
impl StructuralPartialEq for Protocol
impl Sync for Protocol
Auto Trait Implementations§
impl Freeze for Protocol
impl RefUnwindSafe for Protocol
impl Unpin for Protocol
impl UnwindSafe for Protocol
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