SkillAgentSearch skills...

Typic

Type-safe transmutations between layout-compatible types.

Install / Use

/learn @jswrenn/Typic
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

ANNOUNCEMENT: The primary purpose of Typic was to prototype zero-compromise designs for a safe transmute language feature. Read the resulting RFC draft here!


Typic

Typic helps you transmute fearlessly. It worries about the subtleties of soundness and safety so you don't have to!

Documentation Crates.io

Just import it and replace your #[repr(...)] attributes with #[typic::repr(...)]:

// Import it!
use typic::{self, TransmuteInto};

// Update your attributes!
#[typic::repr(C)]
pub struct Foo(pub u8, pub u16);

// Transmute fearlessly!
let _ : Foo = u32::default().transmute_into(); // Alchemy achieved!
let _ : u32 = Foo::default().transmute_into(); // Compiler Error!

License

<sup> Licensed under either of <a href="LICENSE-APACHE">Apache License, Version 2.0</a> or <a href="LICENSE-MIT">MIT license</a> at your option. </sup> <br> <sub> Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this crate by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions. </sub>
View on GitHub
GitHub Stars122
CategoryDevelopment
Updated1y ago
Forks4

Languages

Rust

Security Score

85/100

Audited on Mar 3, 2025

No findings