Unnamed repository; edit this file 'description' to name the repository.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
//! Protocol framing

use std::io::{self, BufRead, Write};

pub trait Framing {
    type Buf: Default + Send + Sync;

    fn read<'a, R: BufRead + ?Sized>(
        inp: &mut R,
        buf: &'a mut Self::Buf,
    ) -> io::Result<Option<&'a mut Self::Buf>>;

    fn write<W: Write + ?Sized>(out: &mut W, buf: &Self::Buf) -> io::Result<()>;
}