infrarust 1.0.1

A Rust adaptation of the Infrared Minecraft proxy
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use bytes::BytesMut;
use std::io::{self, Write};

pub struct BytesMutWriter<'a>(pub &'a mut BytesMut);

impl Write for BytesMutWriter<'_> {
    fn write(&mut self, buf: &[u8]) -> io::Result<usize> {
        self.0.extend_from_slice(buf);
        Ok(buf.len())
    }

    fn flush(&mut self) -> io::Result<()> {
        Ok(())
    }
}