Expand description
Checked versions of the casting functions exposed in crate root
that support CheckedBitPattern types.
Enums§
- Checked
Cast Error - The things that can go wrong when casting between
CheckedBitPatterndata forms.
Traits§
- Checked
BitPattern - 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
- Cast
AintoB - cast_
mut - Cast
&mut Ainto&mut B. - cast_
ref - Cast
&Ainto&B. - cast_
slice - Cast
&[A]into&[B]. - cast_
slice_ mut - Cast
&mut [A]into&mut [B]. - from_
bytes - Re-interprets
&[u8]as&T. - from_
bytes_ mut - Re-interprets
&mut [u8]as&mut T. - pod_
read_ unaligned - Reads the slice into a
Tvalue. - try_
cast - Try to cast
AintoB. - try_
cast_ mut - Try to convert a
&mut Ainto&mut B. - try_
cast_ ref - Try to convert a
&Ainto&B. - try_
cast_ slice - Try to convert
&[A]into&[B](possibly with a change in length). - try_
cast_ slice_ mut - Try to convert
&mut [A]into&mut [B](possibly with a change in length). - try_
from_ bytes - Re-interprets
&[u8]as&T. - try_
from_ bytes_ mut - Re-interprets
&mut [u8]as&mut T. - try_
pod_ read_ unaligned - Reads from the bytes as if they were a
T.