Skip to main content

IIndexAware

Trait IIndexAware 

Source
pub trait IIndexAware {
    // Required methods
    fn index(&self) -> usize;
    fn set_index(&self, index: usize);
}
Expand description

An item that knows its index in a sorted collection (IIndexAware), which UpdateIndex sets.

Deviation (DEVIATIONS.md, DynamicData): the setter takes &self, as the items are shared (Rc) and keep the index in a Cell; the index is a usize.

Required Methods§

Source

fn index(&self) -> usize

The index (Index).

Source

fn set_index(&self, index: usize)

Sets the index (Index).

Dyn Compatibility§

This trait is dyn compatible.

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

Implementations on Foreign Types§

Source§

impl<X: IIndexAware + ?Sized> IIndexAware for Rc<X>

Source§

fn index(&self) -> usize

Source§

fn set_index(&self, index: usize)

Implementors§