Skip to main content

Index

Trait Index 

Source
pub trait Index:
    TryFrom<usize>
    + TryInto<usize>
    + Copy {
    const ZERO: Self;
}
Expand description

An index type used for lookups into and out of arrays.

This is implemented so that Capts can use smaller index sizes (such as u32 or u16) for improved memory performance.

Required Associated Constants§

Source

const ZERO: Self

The zero index. This must be equal to (0usize).try_into().unwrap().

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.

Implementations on Foreign Types§

Source§

impl Index for u8

Source§

const ZERO: Self = 0

Source§

impl Index for u16

Source§

const ZERO: Self = 0

Source§

impl Index for u32

Source§

const ZERO: Self = 0

Source§

impl Index for u64

Source§

const ZERO: Self = 0

Source§

impl Index for usize

Source§

const ZERO: Self = 0

Implementors§