Module bytemuck::allocation
source · Expand description
Stuff to boost things in the alloc
crate.
-
You must enable the
extern_crate_alloc
feature ofbytemuck
or you will not be able to use this module! This is generally done by adding the feature to the dependency in Cargo.toml like so:bytemuck = { version = "VERSION_YOU_ARE_USING", features = ["extern_crate_alloc"]}
Modules§
- sealed 🔒
Structs§
- As
Box<[u8]>
, but remembers the original alignment.
Traits§
- An extension trait for
TransparentWrapper
and alloc types.
Functions§
- Re-interprets
Box<T>
asBoxBytes
. - As
try_cast_arc
, but unwraps for you. - As
try_cast_box
, but unwraps for you. - As
try_cast_rc
, but unwraps for you. - As
try_cast_slice_arc
, but unwraps for you. - As
try_cast_slice_box
, but unwraps for you. - As
try_cast_slice_rc
, but unwraps for you. - As
try_cast_vec
, but unwraps for you. - Re-interprets
BoxBytes
asBox<T>
. - This “collects” a slice of pod data into a vec of a different pod type.
- Attempts to cast the content type of a
Arc
. - Attempts to cast the content type of a
Box
. - Attempts to cast the content type of a
Rc
. - Attempts to cast the content type of a
Arc<[T]>
. - Attempts to cast the content type of a
Box<[T]>
. - Attempts to cast the content type of a
Rc<[T]>
. - Attempts to cast the content type of a
Vec
. - Re-interprets
BoxBytes
asBox<T>
. - Allocates a
Box<T>
with all of the contents being zeroed out. - Allocates a
Box<[T]>
with all contents being zeroed out. - Allocates a
Vec<T>
of length and capacity exactly equal tolength
and all elements zeroed. - As
try_zeroed_box
, but unwraps for you. - As
try_zeroed_slice_box
, but unwraps for you. - As
try_zeroed_vec
but unwraps for you