Expand description
Rust’s own built-in transmute is, ironically, quite limited.
It does not support generically-sized types, nor types with different sizes. This crate provides a more permissive alternative through the use of unions:
raw_transmuteto unsafely transmute between any two types, regardless of size or genericity.raw_transmute_uninitto safely transmute into aMaybeUninitof the destination type.
The MSRV for this crate is Rust 1.31. However, some features require later versions:
- Transmuting into
MaybeUninitrequires Rust 1.36 or later. - Transmuting for non-
Copytypes requires Rust 1.49 or later. constsupport for both functions requires Rust 1.56 or later.
Traits§
- Unionable
- Types that can be used as fields of a union.
Functions§
- raw_
transmute ⚠ - Transmutes a value of type
Srcinto a value of typeDstthrough a union. - raw_
transmute_ uninit - Transmutes a value of type
SrcintoDstwrapped inMaybeUninit.
Unions§
- Transmute
- A
#[repr(C)]union used to transmute between types.