Struct async_prost::AsyncProstStream [−][src]
pub struct AsyncProstStream<S, R, W, D> { /* fields omitted */ }
Expand description
A wrapper around an async stream that receives and sends prost-encoded values
Implementations
Gets a reference to the underlying stream.
It is inadvisable to directly read from or write to the underlying stream.
Gets a mutable reference to the underlying stream.
It is inadvisable to directly read from or write to the underlying stream.
Unwraps this AsyncProstStream
, returning the underlying stream.
Note that any leftover serialized data that has not yet been sent, or received data that has not yet been deserialized, is lost.
make this stream include the serialized data’s size before each serialized value
make this stream include the serialized data’s size before each serialized value
Make this stream only send prost-encoded values
pub fn tcp_split(
&mut self
) -> (AsyncProstReader<ReadHalf<'_>, R, D>, AsyncProstWriter<WriteHalf<'_>, W, D>)
pub fn tcp_split(
&mut self
) -> (AsyncProstReader<ReadHalf<'_>, R, D>, AsyncProstWriter<WriteHalf<'_>, W, D>)
split a TCP-based stream into a read half and a write half
Trait Implementations
impl<S, R, W, D> Sink<W> for AsyncProstStream<S, R, W, D> where
S: Unpin,
AsyncProstWriter<S, W, D>: Sink<W, Error = Error>,
impl<S, R, W, D> Sink<W> for AsyncProstStream<S, R, W, D> where
S: Unpin,
AsyncProstWriter<S, W, D>: Sink<W, Error = Error>,
impl<S, R, W, D> Stream for AsyncProstStream<S, R, W, D> where
S: Unpin,
AsyncProstReader<InternalAsyncWriter<S, W, D>, R, D>: Stream<Item = Result<R, Error>>,
impl<S, R, W, D> Stream for AsyncProstStream<S, R, W, D> where
S: Unpin,
AsyncProstReader<InternalAsyncWriter<S, W, D>, R, D>: Stream<Item = Result<R, Error>>,
Attempt to pull out the next value of this stream, registering the
current task for wakeup if the value is not yet available, and returning
None
if the stream is exhausted. Read more