blob: c8a6263d6445993afce75c8e1c046695299d3c5e [file] [log] [blame]
use std::io;
use vecio::Rawv;
use rustls;
/// This glues our `rustls::WriteV` trait to `vecio::Rawv`.
pub struct WriteVAdapter<'a> {
rawv: &'a mut dyn Rawv
}
impl<'a> WriteVAdapter<'a> {
pub fn new(rawv: &'a mut dyn Rawv) -> WriteVAdapter<'a> {
WriteVAdapter { rawv }
}
}
impl<'a> rustls::WriteV for WriteVAdapter<'a> {
fn writev(&mut self, bytes: &[&[u8]]) -> io::Result<usize> {
self.rawv.writev(bytes)
}
}