Crate raw_transmute

Crate raw_transmute 

Source
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:

The MSRV for this crate is Rust 1.31. However, some features require later versions:

  • Transmuting into MaybeUninit requires Rust 1.36 or later.
  • Transmuting for non-Copy types requires Rust 1.49 or later.
  • const support 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 Src into a value of type Dst through a union.
raw_transmute_uninit
Transmutes a value of type Src into Dst wrapped in MaybeUninit.

Unions§

Transmute
A #[repr(C)] union used to transmute between types.