Expand description
Own namespace of the module.
Modules§
- checked
- Checked versions of the casting functions exposed in crate root
that support
CheckedBitPatterntypes.
Macros§
- offset_
of - Find the offset in bytes of the given
$fieldof$Type. Requires an already initialized$instancevalue to work with.
Enums§
- PodCast
Error - The things that can go wrong when casting between
Poddata forms.
Traits§
- AnyBit
Pattern - Marker trait for “plain old data” types that are valid for any bit pattern.
- AsBytes
- Trait for borrowing data as byte slices.
This trait abstracts the conversion of types that implement Pod (or collections thereof)
into their raw byte representation as a slice (
&[u8]). - 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. - Contiguous
- A trait indicating that:
- Into
Bytes - Trait for consuming data into an owned byte vector.
This trait is for types that can be meaningfully converted into a
Vec< u8 >by consuming the original value. - NoUninit
- Marker trait for “plain old data” types with no uninit (or padding) bytes.
- Pod
- Marker trait for “plain old data”.
- PodIn
Option - Trait for types which are Pod when wrapped in Option.
- Transparent
Wrapper - A trait which indicates that a type is a
#[repr(transparent)]wrapper around theInnervalue. - Zeroable
- Trait for types that can be safely created with
zeroed. - Zeroable
InOption - Trait for types which are Zeroable when wrapped in Option.
Functions§
- bytes_
of - Re-interprets
&Tas&[u8]. - bytes_
of_ mut - Re-interprets
&mut Tas&mut [u8]. - 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]. - fill_
zeroes - Fill all bytes of
slicewith zeroes (seeZeroable). - from_
bytes - Re-interprets
&[u8]as&T. - from_
bytes_ mut - Re-interprets
&mut [u8]as&mut T. - pod_
align_ to - As
align_to, but safe because of thePodbound. - pod_
align_ to_ mut - As
align_to_mut, but safe because of thePodbound. - 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. - write_
zeroes - Fill all bytes of
targetwith zeroes (seeZeroable).
Derive Macros§
- AnyBit
Pattern - Derive the
AnyBitPatterntrait for a struct - Checked
BitPattern - Derive the
CheckedBitPatterntrait for a struct or enum. - Contiguous
- Derive the
Contiguoustrait for an enum - NoUninit
- Derive the
NoUninittrait for a struct or enum - Pod
- Derive the
Podtrait for a struct - Transparent
Wrapper - Derive the
TransparentWrappertrait for a struct - Zeroable
- Derive the
Zeroabletrait for a type.