Expand description
Checked versions of the casting functions exposed in crate root
that support CheckedBitPattern
types.
Macros§
Enums§
- The things that can go wrong when casting between
CheckedBitPattern
data forms.
Traits§
- A marker trait that allows types that have some invalid bit patterns to be used in places that otherwise require
AnyBitPattern
orPod
types 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
A
intoB
- Cast
&mut A
into&mut B
. - Cast
&A
into&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
T
value. - Try to cast
A
intoB
. - Try to convert a
&mut A
into&mut B
. - Try to convert a
&A
into&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
.