[][src]Trait assembly_core::buffer::Unaligned

pub unsafe trait Unaligned: Sized {
    type Value;
    pub fn extract(&self) -> Self::Value;

    pub fn cast(buffer: &[u8], offset: u32) -> &Self { ... }
pub fn cast_slice(buffer: &[u8], offset: u32, len: u32) -> &[Self] { ... } }

Mark this type aligned to a single byte so that it can be used to adress a struct anywhere in a buffer

Associated Types

type Value[src]

The value that this struct encodes

Loading content...

Required methods

pub fn extract(&self) -> Self::Value[src]

extract the contained value

Loading content...

Provided methods

pub fn cast(buffer: &[u8], offset: u32) -> &Self[src]

Cast a buffer to a reference

pub fn cast_slice(buffer: &[u8], offset: u32, len: u32) -> &[Self][src]

Cast a buffer to a slice

Loading content...

Implementors

impl Unaligned for LEI64[src]

type Value = i64

impl Unaligned for LEU16[src]

type Value = u16

impl Unaligned for LEU32[src]

type Value = u32

Loading content...