Struct varu64::Encode
[−]
[src]
pub struct Encode<W> { /* fields omitted */ }
A future for encoding a u64 into an AsyncWrite
.
Methods
impl<W> Encode<W>
[src]
pub fn new(writer: W, int: u64) -> Encode<W>
[src]
Create a new Encode
future for encoding the given u64
into the given W
.
Trait Implementations
impl<W: AsyncWrite> Future for Encode<W>
[src]
type Item = (W, usize)
The wrapped W
, and how many bytes were written into the W
.
type Error = (W, FutError)
Propagated from writing, or an error of kind "WriteZero" if a call to poll_write
returned
0 even though not all data has been written.
fn poll(&mut self, cx: &mut Context) -> Poll<Self::Item, Self::Error>
[src]
Note that this does not flush or close the wrapped W
.
impl<W> AsyncWriterFuture<W> for Encode<W> where
W: AsyncWrite,
[src]
W: AsyncWrite,
fn already_written(&self) -> usize
[src]
Return how many bytes have already been written.
impl<W> AsyncWriterFutureLen<W> for Encode<W> where
W: AsyncWrite,
[src]
W: AsyncWrite,
fn remaining_bytes(&self) -> usize
[src]
Compute the exact number of bytes that will still be written by this future.
impl<W> AsyncSerialize<W> for Encode<W> where
W: AsyncWrite,
[src]
W: AsyncWrite,
type Serialized = u64
The type of values serialized.
fn from_val(writer: W, val: Self::Serialized) -> Self
[src]
Create a new instance, consuming the value to serialize and wrapping the AsyncWrite
to serialize into. Read more
impl<W> AsyncSerializeLen<W> for Encode<W> where
W: AsyncWrite,
[src]
W: AsyncWrite,
fn total_bytes(val: &Self::Serialized) -> usize
[src]
Compute the exact number of bytes that would be written in total if the given value was serialized. Read more