Trait Index

Source
pub trait Index {
    // Required methods
    fn get(&self) -> usize;
    fn new(v: usize) -> Self;
}
Expand description

A type that can be cast into an index.

Note that Index types are assumed to NOT have a significant drop.

Required Methods§

Source

fn get(&self) -> usize

Get the index value of this type.

Source

fn new(v: usize) -> Self

Get the type from the index value.

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§

fn get(&self) -> usize

Source§

fn new(v: usize) -> Self

Source§

impl Index for u16

Source§

fn get(&self) -> usize

Source§

fn new(v: usize) -> Self

Source§

impl Index for u32

Source§

fn get(&self) -> usize

Source§

fn new(v: usize) -> Self

Source§

impl Index for u64

Source§

fn get(&self) -> usize

Source§

fn new(v: usize) -> Self

Source§

impl Index for usize

Source§

fn get(&self) -> usize

Source§

fn new(v: usize) -> Self

Implementors§