Struct async_prost::AsyncProstStream
source · [−]pub struct AsyncProstStream<S, R, W, D> { /* private fields */ }
Expand description
A wrapper around an async stream that receives and sends prost-encoded values
Implementations
sourceimpl<S, R, W, D> AsyncProstStream<S, R, W, D>
impl<S, R, W, D> AsyncProstStream<S, R, W, D>
sourcepub fn get_ref(&self) -> &S
pub fn get_ref(&self) -> &S
Gets a reference to the underlying stream.
It is inadvisable to directly read from or write to the underlying stream.
sourcepub fn get_mut(&mut self) -> &mut S
pub fn get_mut(&mut self) -> &mut S
Gets a mutable reference to the underlying stream.
It is inadvisable to directly read from or write to the underlying stream.
sourcepub fn into_inner(self) -> S
pub fn into_inner(self) -> S
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.
sourceimpl<S, R, W, D> AsyncProstStream<S, R, W, D>
impl<S, R, W, D> AsyncProstStream<S, R, W, D>
sourcepub fn for_async(self) -> AsyncProstStream<S, R, W, AsyncDestination>
pub fn for_async(self) -> AsyncProstStream<S, R, W, AsyncDestination>
make this stream include the serialized data’s size before each serialized value
sourcepub fn for_async_framed(
self
) -> AsyncProstStream<S, R, W, AsyncFrameDestination>
pub fn for_async_framed(
self
) -> AsyncProstStream<S, R, W, AsyncFrameDestination>
make this stream include the serialized data’s size before each serialized value
sourcepub fn for_sync(self) -> AsyncProstStream<S, R, W, SyncDestination>
pub fn for_sync(self) -> AsyncProstStream<S, R, W, SyncDestination>
Make this stream only send prost-encoded values
sourceimpl<R, W, D> AsyncProstStream<TcpStream, R, W, D>
impl<R, W, D> AsyncProstStream<TcpStream, R, W, D>
sourcepub 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
sourceimpl<S, R, W> Default for AsyncProstStream<S, R, W, SyncDestination> where
S: Default,
impl<S, R, W> Default for AsyncProstStream<S, R, W, SyncDestination> where
S: Default,
sourceimpl<S, R, W> From<S> for AsyncProstStream<S, R, W, SyncDestination>
impl<S, R, W> From<S> for AsyncProstStream<S, R, W, SyncDestination>
sourceimpl<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>,
sourcefn poll_ready(
self: Pin<&mut Self>,
cx: &mut Context<'_>
) -> Poll<Result<(), Self::Error>>
fn poll_ready(
self: Pin<&mut Self>,
cx: &mut Context<'_>
) -> Poll<Result<(), Self::Error>>
Attempts to prepare the Sink
to receive a value. Read more
sourcefn start_send(self: Pin<&mut Self>, item: W) -> Result<(), Self::Error>
fn start_send(self: Pin<&mut Self>, item: W) -> Result<(), Self::Error>
Begin the process of sending a value to the sink.
Each call to this function must be preceded by a successful call to
poll_ready
which returned Poll::Ready(Ok(()))
. Read more
sourceimpl<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>>,
Auto Trait Implementations
impl<S, R, W, D> RefUnwindSafe for AsyncProstStream<S, R, W, D> where
D: RefUnwindSafe,
R: RefUnwindSafe,
S: RefUnwindSafe,
W: RefUnwindSafe,
impl<S, R, W, D> Send for AsyncProstStream<S, R, W, D> where
D: Send,
R: Send,
S: Send,
W: Send,
impl<S, R, W, D> Sync for AsyncProstStream<S, R, W, D> where
D: Sync,
R: Sync,
S: Sync,
W: Sync,
impl<S, R, W, D> Unpin for AsyncProstStream<S, R, W, D>
impl<S, R, W, D> UnwindSafe for AsyncProstStream<S, R, W, D> where
D: UnwindSafe,
R: UnwindSafe,
S: UnwindSafe,
W: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more