Trait rando::Memory
[−]
[src]
pub trait Memory<K>: Default { fn len(&self) -> usize; fn contains(&self, key: &K) -> bool; fn push(&mut self, key: K); }
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
fn len(&self) -> usize
Returns the number of K
values stored in self
.
fn contains(&self, key: &K) -> bool
Returns true
if key
has been stored in self
, and false
otherwise.
fn push(&mut self, key: K)
Stores key
in self
.
Implementations on Foreign Types
impl<K, A> Memory<K> for SmallVec<A> where
K: PartialEq,
A: Array<Item = K>,
[src]
K: PartialEq,
A: Array<Item = K>,
impl<K> Memory<K> for Vec<K> where
K: PartialEq,
[src]
K: PartialEq,
impl<K> Memory<K> for BTreeSet<K> where
K: Ord,
[src]
K: Ord,