Allow schemes to be listed

This commit is contained in:
Jeremy Soller 2016-10-13 21:13:37 -06:00
parent d18bf07f3e
commit c907222657
3 changed files with 59 additions and 14 deletions

View file

@ -71,6 +71,14 @@ impl SchemeList {
}
}
pub fn iter(&self) -> ::collections::btree_map::Iter<usize, Arc<Box<Scheme + Send + Sync>>> {
self.map.iter()
}
pub fn iter_name(&self) -> ::collections::btree_map::Iter<Box<[u8]>, usize> {
self.names.iter()
}
/// Get the nth scheme.
pub fn get(&self, id: usize) -> Option<&Arc<Box<Scheme + Send + Sync>>> {
self.map.get(&id)