mclib 0.0.1

Utils and helpers for Minecraft protocol
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
use std::io::Read;

pub trait TcpUtils {
    fn read_byte(&mut self) -> u8;
}

impl TcpUtils for dyn Read + '_ {
    fn read_byte(&mut self) -> u8 {
        let mut buf = [0; 1];
        self.read_exact(&mut buf).unwrap();
        buf[0]
    }
}