Struct objc2::runtime::AnyProtocol
source · #[repr(C)]pub struct AnyProtocol(/* private fields */);
Expand description
A type that represents an Objective-C protocol.
Implementations§
source§impl AnyProtocol
impl AnyProtocol
sourcepub fn get(name: &str) -> Option<&'static Self>
pub fn get(name: &str) -> Option<&'static Self>
Returns the protocol definition of a specified protocol, or None
if the protocol is not registered with the Objective-C runtime.
sourcepub fn protocols(
) -> impl Deref<Target = [&'static Self]> + AsRef<[&'static Self]> + Debug
pub fn protocols( ) -> impl Deref<Target = [&'static Self]> + AsRef<[&'static Self]> + Debug
Obtains the list of registered protocol definitions.
sourcepub fn adopted_protocols(
&self
) -> impl Deref<Target = [&AnyProtocol]> + AsRef<[&AnyProtocol]> + Debug
pub fn adopted_protocols( &self ) -> impl Deref<Target = [&AnyProtocol]> + AsRef<[&AnyProtocol]> + Debug
Get a list of the protocols to which this protocol conforms.
sourcepub fn conforms_to(&self, proto: &AnyProtocol) -> bool
pub fn conforms_to(&self, proto: &AnyProtocol) -> bool
Checks whether this protocol conforms to the specified protocol.
Trait Implementations§
source§impl Debug for AnyProtocol
impl Debug for AnyProtocol
source§impl Display for AnyProtocol
impl Display for AnyProtocol
source§impl PartialEq for AnyProtocol
impl PartialEq for AnyProtocol
source§impl RefEncode for AnyProtocol
impl RefEncode for AnyProtocol
source§const ENCODING_REF: Encoding = Encoding::Object
const ENCODING_REF: Encoding = Encoding::Object
The Objective-C type-encoding for a reference of this type. Read more
impl Eq for AnyProtocol
impl RefUnwindSafe for AnyProtocol
impl Send for AnyProtocol
impl Sync for AnyProtocol
impl UnwindSafe for AnyProtocol
Auto Trait Implementations§
impl !Freeze for AnyProtocol
impl !Unpin for AnyProtocol
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