pub fn try_cast_ref<A, B>(a: &A) -> Result<&B, CheckedCastError>where
A: NoUninit,
B: CheckedBitPattern,Expand description
Try to convert a &A into &B.
§Failure
- If the reference isn’t aligned in the new type
- If the source type and target type aren’t the same size.
- If
acontains an invalid bit pattern forBthis fails.