pub trait IntTraits: Default {
type IntType: TryFrom<BigInt> + Into<BigInt> + Copy;
const IS_SMALL: bool;
const GENERIC_TYPE_ID: GenericTypeId;
const CONST: &'static str;
const EQUAL: &'static str;
const TO_FELT252: &'static str;
const TRY_FROM_FELT252: &'static str;
}
Expand description
Trait for implementing integers.
Required Associated Constants§
Sourceconst IS_SMALL: bool
const IS_SMALL: bool
Is the type smaller than 128 bits. Relevant since some implementations are different due to range check being 128 bits based.
Sourceconst GENERIC_TYPE_ID: GenericTypeId
const GENERIC_TYPE_ID: GenericTypeId
The generic type id for this type.
Sourceconst TO_FELT252: &'static str
const TO_FELT252: &'static str
The generic libfunc id for conversion to felt252.
Sourceconst TRY_FROM_FELT252: &'static str
const TRY_FROM_FELT252: &'static str
The generic libfunc id for conversion from felt252.
Required Associated Types§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.