pub struct AsyncStreamPipe { /* private fields */ }
Implementations§
Source§impl AsyncStreamPipe
impl AsyncStreamPipe
Sourcepub fn new(
reader: impl AsyncRead + Unpin + Send + 'static,
writer: impl AsyncWriteDebug + 'static,
max_messages: usize,
) -> Self
pub fn new( reader: impl AsyncRead + Unpin + Send + 'static, writer: impl AsyncWriteDebug + 'static, max_messages: usize, ) -> Self
Create a new AsyncStreamPipe
from a reader/writer pair.
The pipe will run a background task to read-ahead up to max_messages
messages to make them immediately available to read.
When reader is closed, the background task will exit and further
reads will return an error.
Trait Implementations§
Source§impl<T: Serialize + DeserializeOwned> AsyncPipe<T> for AsyncStreamPipe
impl<T: Serialize + DeserializeOwned> AsyncPipe<T> for AsyncStreamPipe
Auto Trait Implementations§
impl Freeze for AsyncStreamPipe
impl !RefUnwindSafe for AsyncStreamPipe
impl Send for AsyncStreamPipe
impl Sync for AsyncStreamPipe
impl Unpin for AsyncStreamPipe
impl !UnwindSafe for AsyncStreamPipe
Blanket Implementations§
§impl<T> AnySync for T
impl<T> AnySync for T
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
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<A, M> Handler<IndexedErasedUnbound<M>> for A
impl<A, M> Handler<IndexedErasedUnbound<M>> for A
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more