pub struct ProtocolBuilder(/* private fields */);
Expand description
Build a Protocol instance with options.
Implementations§
Source§impl Builder
impl Builder
Sourcepub fn new(initiator: bool) -> Self
pub fn new(initiator: bool) -> Self
Create a protocol builder as initiator (true) or responder (false).
Sourcepub fn connect<IO>(self, io: IO) -> Protocol<IO>
pub fn connect<IO>(self, io: IO) -> Protocol<IO>
Create the protocol from a stream that implements AsyncRead + AsyncWrite + Clone.
Sourcepub fn connect_rw<R, W>(self, reader: R, writer: W) -> Protocol<Duplex<R, W>>
pub fn connect_rw<R, W>(self, reader: R, writer: W) -> Protocol<Duplex<R, W>>
Create the protocol from an AsyncRead reader and AsyncWrite writer.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Builder
impl RefUnwindSafe for Builder
impl Send for Builder
impl Sync for Builder
impl Unpin for Builder
impl UnwindSafe for Builder
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