overlay 1.0.1

An Overlay trait for reinterpreting a slice of bytes as an arbitrary type
Documentation
1
2
3
4
5
6
7
8
9
10
11
#![no_std]

pub trait Overlay {
    fn overlay(bytes: &[u8]) -> Result<&Self, Error>;
    fn overlay_mut(bytes: &mut [u8]) -> Result<&mut Self, Error>;
}

#[derive(Debug, Clone, Copy, Eq, PartialEq)]
pub enum Error {
    InsufficientLength,
}