Function safe_token_2022::pod::pod_maybe_from_bytes
source · pub fn pod_maybe_from_bytes<T: Pod>(
bytes: &[u8]
) -> Result<Option<&T>, ProgramError>
Expand description
Maybe convert a slice into a Pod
(zero copy)
Returns None
if the slice is empty, but Err
if all other lengths but get_packed_len()
This function exists primarily because Option<T>
is not a Pod
.