Expand description

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

This crate works fully on stable Rust, and also does not require the standard library. To disable references to the standard library, you must opt-out of the std feature using default-features = false in your Cargo.toml file.

Castaway provides the following key macros:

  • cast: Attempt to cast the result of an expression into a given concrete type.
  • match_type: Match the result of an expression against multiple concrete types.

Macros

Attempt to cast the result of an expression into a given concrete type.

Match the result of an expression against multiple concrete types.

Traits

Marker trait for types that do not contain any lifetime parameters. Such types are safe to cast from non-static type parameters if their types are equal.