[][src]Function bytemuck::try_cast_ref

pub fn try_cast_ref<A: Pod, B: Pod>(a: &A) -> Result<&B, PodCastError>

Try to convert a &T into &U.

Failure

  • If the reference isn't aligned in the new type
  • If the source type and target type aren't the same size.