[][src]Trait gut::mesh::attrib::Bytes

pub trait Bytes where
    Self: Sized
{ fn as_bytes(&self) -> &[u8] { ... }
fn interpret_bytes(bytes: &[u8]) -> &Self { ... } }

Helper trait to interpret a slice of bytes representing a sized type. Note: this trait is meant to be used transiently on the same platform, and so doesn't care about endianness. In other words, the slice of bytes generated by this trait should not be stored anywhere that outlives the lifetime of the program.

Provided methods

fn as_bytes(&self) -> &[u8]

Get a slice of bytes representing Self.

fn interpret_bytes(bytes: &[u8]) -> &Self

Panics if the size of the given bytes slice is not equal to the size of Self.

Loading content...

Implementors

impl<T: Sized> Bytes for T[src]

Loading content...