A more complete and advanced version of data transmutation.
```rust use cluFullTransmute::mem::full_transmute;
fn main() { let a: bool = unsafe{ fulltransmute(1u8) }; asserteq!(a, true);
let b: bool = unsafe{ full_transmute(0u8) };
assert_eq!(b, false);
// Why does this work?
//
// Is bool one bit?
// No, bool is not one bit, but u8.
//
assert_eq!(std::mem::size_of::<bool>(), 1);
} ```
```rust use cluFullTransmute::mem::full_transmute;
struct A
impl
struct B
impl
fn main() { let data = A(9999usize); //ignore drop!
let b: B<usize> = unsafe{ full_transmute(data) };
assert_eq!(b.0, 9999usize);
b.my_fn();
} ```
Copyright 2019 #UlinProject Denis Kotlyarov (Денис Котляров)
Licensed under the Apache License, Version 2.0