Used to cast values.
This trait’s method is suitable for chaining.
When debug assertions are enabled, this trait’s method panics if the
value does not fit in the destination. When debug assertions are not
enabled (usual in release mode), the wrapped value can be returned,
but it is not considered a breaking change if in the future it panics;
if wrapping is required use
This trait’s method also panics with no debug assertions if the value does not fit and cannot be wrapped, for example when trying to cast floating-point ∞ into an integer type.
use az::Az; assert_eq!(5i32.az::<u32>(), 5); assert_eq!(17.1f32.az::<u8>(), 17);