pub trait Index:
Copy
+ Eq
+ Ord
+ Send
+ Sync
+ Debug
+ Add<Output = Self>
+ Sub<Output = Self> {
// Required methods
fn from_usize(v: usize) -> Self;
fn to_usize(self) -> usize;
fn zero() -> Self;
}Expand description
Trait implemented by integer types usable as suffix array indices.
Provided for u32, u64, and usize. Callers pick the narrowest type
large enough to address their text.
Required Methods§
Sourcefn from_usize(v: usize) -> Self
fn from_usize(v: usize) -> Self
Convert from usize.
Current primitive implementations use Rust’s as casts and
therefore truncate if the value does not fit. Public constructors
dispatch to an index width large enough for their generated
positions; callers that invoke generic internals directly must
choose an I that can represent every position they pass.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".