Struct async_prost::AsyncProstWriter
source · [−]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
sourceimpl<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.
sourceimpl<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
sourceimpl<W, T> Default for AsyncProstWriter<W, T, SyncDestination> where
W: Default,
impl<W, T> Default for AsyncProstWriter<W, T, SyncDestination> where
W: Default,
sourceimpl<W, T> From<W> for AsyncProstWriter<W, T, SyncDestination>
impl<W, T> From<W> for AsyncProstWriter<W, T, SyncDestination>
sourceimpl<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>,
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: 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 more
impl<W, T, D> Unpin for AsyncProstWriter<W, T, D>
Auto Trait Implementations
impl<W, T, D> RefUnwindSafe for AsyncProstWriter<W, T, D> where
D: RefUnwindSafe,
T: RefUnwindSafe,
W: RefUnwindSafe,
impl<W, T, D> Send for AsyncProstWriter<W, T, D> where
D: Send,
T: Send,
W: Send,
impl<W, T, D> Sync for AsyncProstWriter<W, T, D> where
D: Sync,
T: Sync,
W: Sync,
impl<W, T, D> UnwindSafe for AsyncProstWriter<W, T, D> where
D: UnwindSafe,
T: 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