pub struct ArrayFuture<W> { /* private fields */ }

Implementations

Return the underlying writer from this ArrayFuture 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 array length originally written before calling this to destroy the array wrapper.

Return a MsgPackWriter for the next array element

Use for encoding a fixed amount of nesting of arrays/maps that can be modeled with straight-line code. For recursion or looping where the depth is not known at compile time, see next_dyn().

#Panics

Panics if self.is_empty() is true. next() must be called no more times than the array length originally written.

Return a MsgPackWriter for the next array element

Borrows from the ArrayFuture and the returned MsgPackWriter is based on a trait object. This is useful for recursion. It is not possible to manipulate this ArrayFuture while the MsgPackWriter exists, but the user must be careful to write to it before dropping it, or the output will be malformed.

#Panics

Panics if self.is_empty() is true. next() must be called no more times than the array length originally written.

If there is one element left, return a MsgPackWriter for the last array element.

This will yield the underlying writer when the element is written. This avoids have to also call end() after writing this element.

#Panics

Panics if self.len() != 1. next() must have been called as many times as the array length originally written - 1 before calling this to destroy the array wrapper.

Trait Implementations

Attempt to write bytes from buf into the object. Read more

Attempt to flush the object, ensuring that any buffered data reach their destination. Read more

Attempt to close the object. Read more

Attempt to write bytes from bufs into the object using vectored IO operations. Read more

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Creates a future which will entirely flush this AsyncWrite. Read more

Creates a future which will entirely close this AsyncWrite.

Creates a future which will write bytes from buf into the object. Read more

Creates a future which will write bytes from bufs into the object using vectored IO operations. Read more

Write data into this object. Read more

Allow using an [AsyncWrite] as a Sink<Item: AsRef<[u8]>>. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.