raw-transmute

Crates.ioraw-transmute
lib.rsraw-transmute
version1.0.0
created_at2026-01-15 18:20:35.4174+00
updated_at2026-01-15 18:20:35.4174+00
descriptionA more permissive alternative to mem::transmute, because you know better.
homepage
repositoryhttps://codeberg.org/Aseminaunz/raw-transmute
max_upload_size
id2046258
size13,616
Aimar Seminario (Aseminaunz)

documentation

README

Raw Transmute

crates.io docs.rs license repository no-std

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_transmute to unsafely transmute between any two types, regardless of size or genericity.
  • raw_transmute_uninit to safely transmute into a MaybeUninit of the destination type.

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.
Commit count: 0

cargo fmt