Trait stash::Index

source ·
pub trait Index {
    // Required methods
    fn from_usize(idx: usize) -> Self;
    fn into_usize(self) -> usize;
}
Expand description

Every index type to be used with Stash needs to implement this trait

Required Methods§

source

fn from_usize(idx: usize) -> Self

Create an index from usize.

This method should panic if idx is out of acceptable range.

source

fn into_usize(self) -> usize

Turn this index into usize

Implementors§

source§

impl<T> Index for Twhere T: From<usize> + Into<usize>,