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

pub trait Bytes {
    fn as_bytes(&self) -> &[u8]
Notable traits for &'_ [u8]
impl<'_> Read for &'_ [u8]impl<'_> Write for &'_ mut [u8]
{ ... }
fn interpret_bytes(bytes: &[u8]) -> &Self { ... } }
Expand description

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

Get a slice of bytes representing Self.

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

Implementors