pub struct AsyncProstWriter<W, T, D> { /* private fields */ }
Expand description
A warpper around an async sink that accepts, serializes, and sends prost-encoded values.
Implementations§
Source§impl<W, T, D> AsyncProstWriter<W, T, D>
impl<W, T, D> AsyncProstWriter<W, T, D>
Sourcepub fn into_inner(self) -> W
pub fn into_inner(self) -> W
Unwraps this AsyncProstWriter
, returning the underlying writer.
Note that any leftover serialized data that has not yet been sent is lost.
Source§impl<W, T> AsyncProstWriter<W, T, SyncDestination>
impl<W, T> AsyncProstWriter<W, T, SyncDestination>
Sourcepub fn for_async(self) -> AsyncProstWriter<W, T, AsyncDestination>
pub fn for_async(self) -> AsyncProstWriter<W, T, AsyncDestination>
make this writer include the serialized data’s size before each serialized value.
Sourcepub fn for_async_framed(self) -> AsyncProstWriter<W, T, AsyncFrameDestination>
pub fn for_async_framed(self) -> AsyncProstWriter<W, T, AsyncFrameDestination>
make this writer include the serialized data’s header and body size before serialized value
Trait Implementations§
Source§impl<W, T> Default for AsyncProstWriter<W, T, SyncDestination>where
W: Default,
impl<W, T> Default for AsyncProstWriter<W, T, SyncDestination>where
W: Default,
Source§impl<W, T> From<W> for AsyncProstWriter<W, T, SyncDestination>
impl<W, T> From<W> for AsyncProstWriter<W, T, SyncDestination>
Source§impl<W, T, D> Sink<T> for AsyncProstWriter<W, T, D>where
W: AsyncWrite + Unpin,
Self: ProstWriterFor<T>,
impl<W, T, D> Sink<T> for AsyncProstWriter<W, T, D>where
W: AsyncWrite + Unpin,
Self: ProstWriterFor<T>,
Source§fn 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 moreSource§fn start_send(self: Pin<&mut Self>, item: T) -> Result<(), Self::Error>
fn start_send(self: Pin<&mut Self>, item: T) -> 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 moreimpl<W, T, D> Unpin for AsyncProstWriter<W, T, D>
Auto Trait Implementations§
impl<W, T, D> Freeze for AsyncProstWriter<W, T, D>where
W: Freeze,
impl<W, T, D> RefUnwindSafe for AsyncProstWriter<W, T, D>
impl<W, T, D> Send for AsyncProstWriter<W, T, D>
impl<W, T, D> Sync for AsyncProstWriter<W, T, D>
impl<W, T, D> UnwindSafe for AsyncProstWriter<W, T, D>
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
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