Expand description
This module defines the various error types that can be produced by a failed conversion.
In addition, it also defines some extension traits to make working with failable conversions more ergonomic (see the Unwrap*
traits).
Structs§
- NegOverflow
- Indicates that the conversion failed due to a negative overflow.
- PosOverflow
- Indicates that the conversion failed due to a positive overflow.
- Unrepresentable
- Indicates that the conversion failed because the value was not representable.
Enums§
- Float
Error - Indicates that a conversion from a floating point type failed.
- General
Error - A general error enumeration that subsumes all other conversion errors.
- General
Error Kind - A general error enumeration that subsumes all other conversion errors, but discards all input payloads the errors may be carrying.
- NoError
- Indicates that it is not possible for the conversion to fail.
- Range
Error - Indicates that a conversion failed due to a range error.
- Range
Error Kind - Indicates that a conversion failed due to a range error.
Traits§
- Saturate
- Saturates a
Result
. - Unwrap
Ok - Safely unwrap a
Result
that cannot contain an error. - Unwrap
OrInf - Unwrap a conversion by saturating to infinity.
- Unwrap
OrInvalid - Unwrap a conversion by replacing a failure with an invalid sentinel value.
- Unwrap
OrSaturate - Unwrap a conversion by saturating.