pub struct ProtocolBuilder { /* private fields */ }Expand description
A type for creating a new protocol and adding new methods to it before registering it.
Implementations§
Source§impl ProtocolBuilder
impl ProtocolBuilder
Sourcepub fn new(name: &CStr) -> Option<Self>
pub fn new(name: &CStr) -> Option<Self>
Constructs a ProtocolBuilder with the given name.
Returns None if the protocol couldn’t be allocated.
§Panics
Panics if the name contains an internal NULL byte.
Sourcepub fn add_method_description<Args, Ret>(&mut self, sel: Sel, required: bool)where
Args: EncodeArguments,
Ret: EncodeReturn,
pub fn add_method_description<Args, Ret>(&mut self, sel: Sel, required: bool)where
Args: EncodeArguments,
Ret: EncodeReturn,
Add an instance method with a given description.
Sourcepub fn add_class_method_description<Args, Ret>(
&mut self,
sel: Sel,
required: bool,
)where
Args: EncodeArguments,
Ret: EncodeReturn,
pub fn add_class_method_description<Args, Ret>(
&mut self,
sel: Sel,
required: bool,
)where
Args: EncodeArguments,
Ret: EncodeReturn,
Add a class method with a given description.
Sourcepub fn add_protocol(&mut self, proto: &AnyProtocol)
pub fn add_protocol(&mut self, proto: &AnyProtocol)
Adds a requirement on another protocol.
Sourcepub fn register(self) -> &'static AnyProtocol
pub fn register(self) -> &'static AnyProtocol
Registers the ProtocolBuilder, consuming it and returning a reference
to the newly registered AnyProtocol.
Trait Implementations§
Source§impl Debug for ProtocolBuilder
impl Debug for ProtocolBuilder
Source§impl Drop for ProtocolBuilder
impl Drop for ProtocolBuilder
impl Send for ProtocolBuilder
impl Sync for ProtocolBuilder
Auto Trait Implementations§
impl Freeze for ProtocolBuilder
impl RefUnwindSafe for ProtocolBuilder
impl Unpin for ProtocolBuilder
impl UnwindSafe for ProtocolBuilder
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