Struct rmp_futures::encode::MapFuture
source · [−]pub struct MapFuture<W> { /* private fields */ }Implementations
sourceimpl<W: AsyncWrite + Unpin> MapFuture<W>
impl<W: AsyncWrite + Unpin> MapFuture<W>
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
sourcepub fn end(self) -> W
pub fn end(self) -> W
Return the underlying writer from this MapFuture that has already
written all elements (len == 0).
#Panics
Panics if self.is_empty() is false. next() must have been called as
many times as the map length originally written before calling this to
destroy the array wrapper.
pub fn next_key(self) -> MsgPackOption<MsgPackWriter<MsgPackWriter<Self>>, W>
pub fn next_key_dyn(
&mut self
) -> Option<MsgPackWriter<MsgPackWriter<&mut (dyn AsyncWrite + Send + Unpin)>>>where
W: Send,
sourcepub fn last_key(self) -> MsgPackOption<MsgPackWriter<MsgPackWriter<W>>, W>
pub fn last_key(self) -> MsgPackOption<MsgPackWriter<MsgPackWriter<W>>, W>
If this is the last element, return a future of it’s value wrapped around the
underlying writer. Avoids having to call next() a final time.
pub async fn write_value(self, a: &[(Value, Value)]) -> IoResult<W>where
W: Send,
pub async fn write_value_ref<'a>(
self,
a: &[(ValueRef<'a>, ValueRef<'a>)]
) -> IoResult<W>where
W: Send,
Trait Implementations
sourceimpl<W: AsyncWrite + Unpin> AsyncWrite for MapFuture<W>
impl<W: AsyncWrite + Unpin> AsyncWrite for MapFuture<W>
sourcefn poll_write(
self: Pin<&mut Self>,
cx: &mut Context<'_>,
buf: &[u8]
) -> Poll<IoResult<usize>>
fn poll_write(
self: Pin<&mut Self>,
cx: &mut Context<'_>,
buf: &[u8]
) -> Poll<IoResult<usize>>
Attempt to write bytes from buf into the object. Read more
sourcefn poll_flush(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<IoResult<()>>
fn poll_flush(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<IoResult<()>>
Attempt to flush the object, ensuring that any buffered data reach their destination. Read more
Auto Trait Implementations
impl<W> RefUnwindSafe for MapFuture<W>where
W: RefUnwindSafe,
impl<W> Send for MapFuture<W>where
W: Send,
impl<W> Sync for MapFuture<W>where
W: Sync,
impl<W> Unpin for MapFuture<W>where
W: Unpin,
impl<W> UnwindSafe for MapFuture<W>where
W: UnwindSafe,
Blanket Implementations
impl<W> AsyncWriteExt for Wwhere
W: AsyncWrite + ?Sized,
impl<W> AsyncWriteExt for Wwhere
W: AsyncWrite + ?Sized,
fn flush(&mut self) -> Flush<'_, Self>where
Self: Unpin,
fn flush(&mut self) -> Flush<'_, Self>where
Self: Unpin,
Creates a future which will entirely flush this AsyncWrite. Read more
fn close(&mut self) -> Close<'_, Self>where
Self: Unpin,
fn close(&mut self) -> Close<'_, Self>where
Self: Unpin,
Creates a future which will entirely close this AsyncWrite.
fn write(&'a mut self, buf: &'a [u8]) -> Write<'a, Self>where
Self: Unpin,
fn write(&'a mut self, buf: &'a [u8]) -> Write<'a, Self>where
Self: Unpin,
Creates a future which will write bytes from buf into the object. Read more
fn write_vectored(
&'a mut self,
bufs: &'a [IoSlice<'a>]
) -> WriteVectored<'a, Self>where
Self: Unpin,
fn write_vectored(
&'a mut self,
bufs: &'a [IoSlice<'a>]
) -> WriteVectored<'a, Self>where
Self: Unpin,
Creates a future which will write bytes from bufs into the object using vectored
IO operations. Read more
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
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