Skip to main content

pod_from_bytes_mut

Function pod_from_bytes_mut 

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

Zero-copy cast from bytes to a mutable reference.

ยงSafety

The returned reference aliases the input slice mutably. Callers must not create overlapping references (mutable or immutable) to the same memory.