RingGet

Trait RingGet 

Source
pub trait RingGet<V> {
    // Required method
    fn ring_get(&self, index: usize) -> &V;
}
Expand description

Trait describes a collection which can get a value by it’s index. The index can be in any range, even [length(implementor), ..).

The key feature of the trait is that the implementor should guarantee that with under provided index there’s always some value. The best way to do that is to implement a trait for a guaranteed not empty type.

Required Methods§

Source

fn ring_get(&self, index: usize) -> &V

Returns with a guarantee a value under index.

Implementors§

Source§

impl<V> RingGet<V> for NonEmpty<V>