devela::_dep::bytemuck

Function try_from_bytes_mut

pub fn try_from_bytes_mut<T>(s: &mut [u8]) -> Result<&mut T, PodCastError> 
Available on crate feature dep_bytemuck only.
Expand description

Re-interprets &mut [u8] as &mut T.

§Failure

  • If the slice isn’t aligned for the new type
  • If the slice’s length isn’t exactly the size of the new type