Module mz_ore::cast

source ·
Expand description

Cast utilities.

Re-exports§

Modules§

Macros§

  • cast_from 🔒
  • cast_lossy 🔒
    Implement CastLossy for the specified types.
  • Implement TryCastFrom for the specified types. This is only necessary for types for which as exists, but TryFrom doesn’t (notably floats).

Traits§

  • A trait for safe, simple, and infallible casts.
  • The inverse of CastFrom. Implemented automatically, just like std::convert::Into.
  • A trait for potentially-lossy casts. Typically useful when converting from integers to floating point, and you want the nearest floating-point number to your integer when your integer is large, or vice versa.
  • A trait for reinterpreting casts.
  • A trait for attempted casts.

Functions§