Module num_traits::cast
source ยท Macrosยง
- impl_
as_ ๐primitive - impl_
from_ ๐primitive - impl_
num_ ๐cast
Traitsยง
- A generic interface for casting between machine scalars with the
as
operator, which admits narrowing and precision loss. Implementers of this traitAsPrimitive
should behave like a primitive numeric type (e.g. a newtype around another primitive), and the intended conversion must never fail. - A generic trait for converting a number to a value.
- An interface for casting between machine scalars.
- A generic trait for converting a value to a number.
Functionsยง
- Cast from one machine scalar to another.