pub trait IntegerPType:
NativePType
+ PrimInt
+ ToPrimitive
+ Bounded
+ AddAssign
+ AsPrimitive<usize> {
// Provided method
fn max_value_as_u64() -> u64 { ... }
}Expand description
Trait for integer primitive types that can be used as indices, offsets, or codes.
Includes all signed and unsigned integer types (u8, u16, u32, u64, i8, i16, i32, i64).
You can use the match_each_integer_ptype macro to help with writing “generic” code over
dynamically typed code.
Provided Methods§
Sourcefn max_value_as_u64() -> u64
fn max_value_as_u64() -> u64
Returns the maximum offset value that can be represented by this type.
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.
Implementors§
impl<T> IntegerPType for T
Implements IntegerPType for all possible T that have the correct bounds.