Function lrs::mem::from_bytes

Turns a slice into a reference to a Pod type if it's suitable.

Syntax

fn from_bytes<T>(buf: &[u8]) -> Option<&T>
    where T: Pod,

Arguments

NameDescription
buf

The buffer to be turned into a reference.

Return value

Returns the created reference.

Remarks

The buffer is suitable under the conditions described in is_suitable_for.