Skip to main content

pod_from_bytes

Function pod_from_bytes 

Source
pub fn pod_from_bytes<T>(data: &[u8]) -> Result<&T, ProgramError>
where T: Pod + FixedLayout,
Expand description

Zero-copy cast from bytes to an immutable reference.

ยงSafety

The returned reference aliases the input slice. Callers must not create overlapping mutable references to the same memory.