netcode-rs 1.4.0

Rust implementation of the netcode protocol
Documentation
1
2
3
4
5
6
7
8
use byteorder::{ReadBytesExt, WriteBytesExt};

pub trait Bytes: Sized {
    const SIZE: usize = std::mem::size_of::<Self>();
    type Error;
    fn write_to(&self, writer: &mut impl WriteBytesExt) -> Result<(), Self::Error>;
    fn read_from(reader: &mut impl ReadBytesExt) -> Result<Self, Self::Error>;
}