pub struct Transport {
pub reader: BoxReader,
pub writer: BoxWriter,
}Expand description
The two halves of a byte stream.
Fields§
§reader: BoxReaderWhere incoming bytes come from.
writer: BoxWriterWhere outgoing bytes go.
Implementations§
Source§impl Transport
impl Transport
Sourcepub fn new(
reader: impl AsyncRead + Send + Unpin + 'static,
writer: impl AsyncWrite + Send + Unpin + 'static,
) -> Self
pub fn new( reader: impl AsyncRead + Send + Unpin + 'static, writer: impl AsyncWrite + Send + Unpin + 'static, ) -> Self
Wraps separate reading and writing halves.
Sourcepub fn from_stream(stream: impl AsyncRead + AsyncWrite + Send + 'static) -> Self
pub fn from_stream(stream: impl AsyncRead + AsyncWrite + Send + 'static) -> Self
Splits a bidirectional stream into a transport.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Transport
impl !Sync for Transport
impl !UnwindSafe for Transport
impl Forget for Transport
impl Freeze for Transport
impl Move for Transport
impl Send for Transport
impl Unpin for Transport
impl UnsafeUnpin for Transport
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