Skip to main content

AsyncWriteVarintExt

Trait AsyncWriteVarintExt 

Source
pub trait AsyncWriteVarintExt: AsyncWrite + Unpin {
    // Required methods
    fn write_varint_u64(
        &mut self,
        value: u64,
    ) -> impl Future<Output = Result<usize>>;
    fn write_length_prefixed<T: Serialize>(
        &mut self,
        value: T,
    ) -> impl Future<Output = Result<usize>>;
}
Available on crate features rpc or varint-util only.
Expand description

Provides a fn to write a varint to an io::Write target, as well as a helper to write a length-prefixed value.

Required Methods§

Source

fn write_varint_u64( &mut self, value: u64, ) -> impl Future<Output = Result<usize>>

Write a varint

Source

fn write_length_prefixed<T: Serialize>( &mut self, value: T, ) -> impl Future<Output = Result<usize>>

Write a value with a varint encoded length prefix.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§