laminar 0.5.0

A simple semi-reliable UDP protocol for multiplayer games
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
use std::io::Cursor;

/// Trait that supports reading a Header from a packet
pub trait HeaderReader {
    /// Associated type for the HeaderReader, since it reads it from a Header
    type Header;

    /// Reads the specified header from the given Cursor.
    fn read(rdr: &mut Cursor<&[u8]>) -> Self::Header;

    /// Returns the size of the header.
    fn size() -> u8;
}