Skip to main content

TableKey

Trait TableKey 

Source
pub trait TableKey: Copy {
    // Required methods
    fn new(index: usize) -> Self;
    fn invalid() -> Self;
    fn index(self) -> usize;
    fn is_invalid(self) -> bool;
}
Expand description

An opaque key to uniquely identify a table entry.

Required Methods§

Source

fn new(index: usize) -> Self

Create a new table key from an index.

Source

fn invalid() -> Self

Create an invalid table key.

Source

fn index(self) -> usize

Return the index wrapped within this table key.

Source

fn is_invalid(self) -> bool

Return whether this table key is invalid.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§