Registry / utility / castaway

castaway

JSON →
library0.2.4rscratesunverified

Safe, zero-cost downcasting for limited compile-time specialization.

# Cargo.toml [dependencies] castaway = "0.2.4"
INSTALL
IMPORT
SIG · CASTAWAY
C
castaway
utilityrustv0.2.4
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

cast
use castaway::cast;

Downcast a trait object to a concrete type safely.

use castaway::cast; fn main() { let value: Box<dyn std::any::Any> = Box::new(42u32); if let Some(num) = cast::<u32>(&*value) { println!("Number: {}", num); } }
Debug
Known issues

No known issues recorded.

Upgrade
Version history
0.2.4latest on crates.io
Audit
Dependencies

No dependency data recorded yet.

Agent activity
6 hits · last 30 days
node
6
Resources
castaway — cargo add castaway · libregistry