pub struct Protocol { /* private fields */ }Expand description
A Swift protocol descriptor, read only as far as this needs.
Implementations§
Source§impl Protocol
impl Protocol
Sourcepub unsafe fn from_symbol(symbol: &'static CStr) -> Self
pub unsafe fn from_symbol(symbol: &'static CStr) -> Self
Sourcepub fn requirement_count(&self) -> usize
pub fn requirement_count(&self) -> usize
How many requirements the protocol has, and so how wide a witness table for it must be.
Sourcepub fn describe(&self)
pub fn describe(&self)
Print each requirement’s kind and whether it has a default.
Only for working out what a protocol needs; nothing depends on it.
Sourcepub fn has_default(&self, i: usize) -> bool
pub fn has_default(&self, i: usize) -> bool
The default implementation of requirement i, if it has one.
Whether requirement i has a default, and so need not be supplied.
The ratio of defaults to requirements is what decides whether a
conformance is worth synthesising: View has one requirement and
several defaults, Layout has many of each.
Auto Trait Implementations§
impl !Send for Protocol
impl !Sync for Protocol
impl Freeze for Protocol
impl RefUnwindSafe for Protocol
impl Unpin for Protocol
impl UnsafeUnpin 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