Trait Streamable

Source
pub trait Streamable {
    // Required method
    fn read<T>(stream: &mut T) -> impl Future<Output = Result<Self>> + Send
       where Self: Sized,
             T: AsyncReadExt + Unpin + Send;

    // Provided method
    fn write<T>(
        &self,
        stream: &mut T,
    ) -> impl Future<Output = Result<()>> + Send
       where Self: ToBytes + Send + Sync,
             T: AsyncWriteExt + Unpin + Send { ... }
}

Required Methods§

Source

fn read<T>(stream: &mut T) -> impl Future<Output = Result<Self>> + Send
where Self: Sized, T: AsyncReadExt + Unpin + Send,

Provided Methods§

Source

fn write<T>(&self, stream: &mut T) -> impl Future<Output = Result<()>> + Send
where Self: ToBytes + Send + Sync, T: AsyncWriteExt + Unpin + Send,

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl Streamable for Vec<Method>

Source§

async fn read<T>(stream: &mut T) -> Result<Self>
where T: AsyncReadExt + Unpin + Send,

§Authentication Methods
§Stream
         +-----+----------+----------+
         | VER | NMETHODS | METHODS  |
         +-----+----------+----------+
         |  1  |    1     | 1 to 255 |
         +-----+----------+----------+

Implementors§