Skip to main content

Lookup

Trait Lookup 

Source
pub trait Lookup<I, T>: LutType<T> {
    // Required method
    fn lookup(table: &Self::Table, index: I) -> &T;
}
Expand description

Index a lookup table with any value of type I.

Required Methods§

Source

fn lookup(table: &Self::Table, index: I) -> &T

Get the value at an index.

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<'a, T, I, V> Lookup<I, V> for &'a T
where T: Lookup<I, V>, <T as LutType<V>>::Table: 'a,

Source§

fn lookup(table: &<&'a T as LutType<V>>::Table, index: I) -> &V

Implementors§

Source§

impl<I, T> Lookup<I, T> for SliceTable
where usize: From<I>,

Source§

impl<I, T> Lookup<I, T> for VecTable
where usize: From<I>,

Available on crate feature alloc only.
Source§

impl<T> Lookup<u8, T> for ArrayTable<256>

Source§

impl<T> Lookup<u16, T> for ArrayTable<65536>