static-mapset 0.1.0

Maps and sets based on ordered array or slice
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#[cfg(feature = "std")]
use std::collections::BTreeSet;

pub trait Ordered<'a, T: 'a + PartialOrd> {
	type Iter: Iterator<Item = &'a T>;

	fn ordered_iter(&'a self) -> Self::Iter;
}

#[cfg(feature = "std")]
impl<'a, T: 'a + PartialOrd> Ordered<'a, T> for BTreeSet<T> {
	type Iter = std::collections::btree_set::Iter<'a, T>;

	fn ordered_iter(&'a self) -> Self::Iter {
		self.iter()
	}
}