Expand description
Checked versions of the casting functions exposed in crate root
that support CheckedBitPattern types.
Enums§
- The things that can go wrong when casting between
CheckedBitPatterndata forms.
Traits§
- A marker trait that allows types that have some invalid bit patterns to be used in places that otherwise require
AnyBitPatternorPodtypes by performing a runtime check on a perticular set of bits. This is particularly useful for types like fieldless (‘C-style’) enums,char, bool, and structs containing them.
Functions§
- Cast
AintoB - Cast
&mut Ainto&mut B. - Cast
&Ainto&B. - Cast
&[A]into&[B]. - Cast
&mut [A]into&mut [B]. - Re-interprets
&[u8]as&T. - Re-interprets
&mut [u8]as&mut T. - Reads the slice into a
Tvalue. - Try to cast
AintoB. - Try to convert a
&mut Ainto&mut B. - Try to convert a
&Ainto&B. - Try to convert
&[A]into&[B](possibly with a change in length). - Try to convert
&mut [A]into&mut [B](possibly with a change in length). - Re-interprets
&[u8]as&T. - Re-interprets
&mut [u8]as&mut T. - Reads from the bytes as if they were a
T.