Memory

Trait Memory 

Source
pub trait Memory<K>: Default {
    // Required methods
    fn len(&self) -> usize;
    fn contains(&self, key: &K) -> bool;
    fn push(&mut self, key: K);
}
Expand description

A trait for data-structures in which a RandIter can store values of type K representing the indices or other keys of the items that it has already yielded.

Required Methods§

Source

fn len(&self) -> usize

Returns the number of K values stored in self.

Source

fn contains(&self, key: &K) -> bool

Returns true if key has been stored in self, and false otherwise.

Source

fn push(&mut self, key: K)

Stores key in self.

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<K> Memory<K> for BTreeSet<K>
where K: Ord,

Source§

fn len(&self) -> usize

Source§

fn contains(&self, key: &K) -> bool

Source§

fn push(&mut self, key: K)

Source§

impl<K> Memory<K> for Vec<K>
where K: PartialEq,

Source§

fn len(&self) -> usize

Source§

fn contains(&self, key: &K) -> bool

Source§

fn push(&mut self, key: K)

Source§

impl<K, A> Memory<K> for SmallVec<A>
where K: PartialEq, A: Array<Item = K>,

Source§

fn len(&self) -> usize

Source§

fn contains(&self, key: &K) -> bool

Source§

fn push(&mut self, key: K)

Implementors§