Skip to main content

Index

Trait Index 

Source
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§

Source

fn from_usize(v: usize) -> Self

Convert from usize. Panics if the value does not fit.

Source

fn to_usize(self) -> usize

Convert to usize. Lossless for u32/u64/usize on 64-bit targets.

Source

fn zero() -> Self

The zero value.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl Index for u32

Source§

fn from_usize(v: usize) -> Self

Source§

fn to_usize(self) -> usize

Source§

fn zero() -> Self

Source§

impl Index for u64

Source§

fn from_usize(v: usize) -> Self

Source§

fn to_usize(self) -> usize

Source§

fn zero() -> Self

Source§

impl Index for usize

Source§

fn from_usize(v: usize) -> Self

Source§

fn to_usize(self) -> usize

Source§

fn zero() -> Self

Implementors§