Trait rustls::WriteV[][src]

pub trait WriteV {
    fn writev(&mut self, vbytes: &[&[u8]]) -> Result<usize>;
}

This trait specifies rustls's precise requirements doing writes with vectored IO.

The purpose of vectored IO is to pass contigious output in many blocks to the kernel without either coalescing it in user-mode (by allocating and copying) or making many system calls.

We don't directly use types from the vecio crate because the traits don't compose well: the most useful trait (Rawv) is hard to test with (it can't be implemented without an FD) and implies a readable source too. You will have to write a trivial adaptor struct which glues either vecio::Rawv or vecio::Writev to this trait. See the rustls examples.

Required Methods

Writes as much data from vbytes as possible, returning the number of bytes written.

Implementors