Struct rax::RaxSet [−][src]
pub struct RaxSet<K: RaxKey> { /* fields omitted */ }
RaxMap but without the values. The "isnull" bit will be set for all entries. #Examples
let mut r = RaxSet::new(); r.insert(1); r.insert(2); r.iter(|r, iter| { // Place iterator at the first entry. if !iter.seek_min() { // EOF return } // Can test EOF at any time. if iter.eof() { // EOF return } while iter.forward() { iter.key(); } // In reverse // Place iterator at the end. if !iter.end() { // EOF return } while iter.back() { iter.key(); } // Seek if !iter.seek(">=", 2) { // EOF } while iter.forward() { iter.key(); } });
Methods
impl<K: RaxKey> RaxSet<K>
[src]
impl<K: RaxKey> RaxSet<K>
pub fn new() -> RaxSet<K>
[src]
pub fn new() -> RaxSet<K>
pub fn len(&self) -> u64
[src]
pub fn len(&self) -> u64
The number of entries in the RAX
pub fn size(&self) -> u64
[src]
pub fn size(&self) -> u64
The number of entries in the RAX
pub fn show(&self)
[src]
pub fn show(&self)
Prints the Rax as ASCII art to stdout.
pub fn insert(&mut self, key: K) -> Result<bool, RaxError>
[src]
pub fn insert(&mut self, key: K) -> Result<bool, RaxError>
Insert a new entry into the RAX replacing and returning the existing entry for the supplied key.
pub fn remove(&mut self, key: K) -> bool
[src]
pub fn remove(&mut self, key: K) -> bool
pub fn exists(&self, key: K) -> bool
[src]
pub fn exists(&self, key: K) -> bool
Determines if the supplied key exists in the Rax.
pub fn seek_min<F>(&mut self, f: F) where
F: Fn(&mut RaxSet<K>, &mut RaxIterator<K, usize>),
[src]
pub fn seek_min<F>(&mut self, f: F) where
F: Fn(&mut RaxSet<K>, &mut RaxIterator<K, usize>),
pub fn seek_min_result<R, F>(&mut self, f: F) -> Result<R, RaxError> where
F: Fn(&mut RaxSet<K>, &mut RaxIterator<K, usize>) -> Result<R, RaxError>,
[src]
pub fn seek_min_result<R, F>(&mut self, f: F) -> Result<R, RaxError> where
F: Fn(&mut RaxSet<K>, &mut RaxIterator<K, usize>) -> Result<R, RaxError>,
pub fn seek_max<F>(&mut self, f: F) where
F: Fn(&mut RaxSet<K>, &mut RaxIterator<K, usize>),
[src]
pub fn seek_max<F>(&mut self, f: F) where
F: Fn(&mut RaxSet<K>, &mut RaxIterator<K, usize>),
pub fn seek_max_result<R, F>(&mut self, f: F) -> Result<R, RaxError> where
F: Fn(&mut RaxSet<K>, &mut RaxIterator<K, usize>) -> Result<R, RaxError>,
[src]
pub fn seek_max_result<R, F>(&mut self, f: F) -> Result<R, RaxError> where
F: Fn(&mut RaxSet<K>, &mut RaxIterator<K, usize>) -> Result<R, RaxError>,
pub fn seek<F>(&mut self, op: &str, key: K, f: F) where
F: Fn(&mut RaxSet<K>, &mut RaxIterator<K, usize>),
[src]
pub fn seek<F>(&mut self, op: &str, key: K, f: F) where
F: Fn(&mut RaxSet<K>, &mut RaxIterator<K, usize>),
pub fn seek_result<R, F>(
&mut self,
op: &str,
key: K,
f: F
) -> Result<R, RaxError> where
F: Fn(&mut RaxSet<K>, &mut RaxIterator<K, usize>) -> Result<R, RaxError>,
[src]
pub fn seek_result<R, F>(
&mut self,
op: &str,
key: K,
f: F
) -> Result<R, RaxError> where
F: Fn(&mut RaxSet<K>, &mut RaxIterator<K, usize>) -> Result<R, RaxError>,
pub fn iter<F>(&mut self, f: F) where
F: Fn(&mut RaxSet<K>, &mut RaxIterator<K, usize>),
[src]
pub fn iter<F>(&mut self, f: F) where
F: Fn(&mut RaxSet<K>, &mut RaxIterator<K, usize>),
pub fn iter_result<F, R>(&mut self, f: F) -> Result<R, RaxError> where
F: Fn(&mut RaxSet<K>, &mut RaxIterator<K, usize>) -> Result<R, RaxError>,
[src]
pub fn iter_result<F, R>(&mut self, f: F) -> Result<R, RaxError> where
F: Fn(&mut RaxSet<K>, &mut RaxIterator<K, usize>) -> Result<R, RaxError>,