Module traits
SourceDescription
Foundational traits for arithmetic, comparison, conversion, and formatting.
Declares the lang-bound traits used throughout the stdlib (Add / Sub / Mul / Div, Eq / Ord, Not, From / Into, TryFrom / TryInto, Display / Debug, Hash, Default, Error, LowerHex, Binary) and wires primitive-type impls to host intrinsics.
Abstractions
Traits
- Add
Binary addition.
- Binary
Base-2 (binary) formatting.
- Debug
Diagnostic formatted representation intended for developers.
- Default
Produce the canonical default value for
Self(0 for numerics,""forStr, empty container, etc.).- Display
User-facing formatted representation.
- Div
Binary division.
- Eq
Equality comparison.
- Error
Marker trait for error types.
- From
Infallible construction of
Selffrom asourcevalue.- Hash
Produce a 64-bit hash of
Self.- Into
Infallible conversion of
Selfinto atargettype.- LowerHex
Lowercase hexadecimal formatting.
- Mul
Binary multiplication.
- Not
Logical or bitwise negation.
- Ord
Total ordering.
- Sub
Binary subtraction.
- TryFrom
Fallible construction of
Selffrom asourcevalue; returns(Result Self error).- TryInto
Fallible conversion of
Selfinto atargettype; returns(Result target error).