pub struct RaxSet<K: RaxKey> { /* private fields */ }Expand description
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();
}
});Implementations§
Source§impl<K: RaxKey> RaxSet<K>
impl<K: RaxKey> RaxSet<K>
pub fn new() -> RaxSet<K>
Sourcepub fn insert(&mut self, key: K) -> Result<bool, RaxError>
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
Sourcepub fn seek_min_result<R, F>(&mut self, f: F) -> Result<R, RaxError>
pub fn seek_min_result<R, F>(&mut self, f: F) -> Result<R, RaxError>
Sourcepub fn seek_max_result<R, F>(&mut self, f: F) -> Result<R, RaxError>
pub fn seek_max_result<R, F>(&mut self, f: F) -> Result<R, RaxError>
Sourcepub fn seek_result<R, F>(
&mut self,
op: &str,
key: K,
f: F,
) -> Result<R, RaxError>
pub fn seek_result<R, F>( &mut self, op: &str, key: K, f: F, ) -> Result<R, RaxError>
Sourcepub fn iter_result<F, R>(&mut self, f: F) -> Result<R, RaxError>
pub fn iter_result<F, R>(&mut self, f: F) -> Result<R, RaxError>
Trait Implementations§
Auto Trait Implementations§
impl<K> Freeze for RaxSet<K>
impl<K> RefUnwindSafe for RaxSet<K>where
K: RefUnwindSafe,
impl<K> !Send for RaxSet<K>
impl<K> !Sync for RaxSet<K>
impl<K> Unpin for RaxSet<K>where
K: Unpin,
impl<K> UnwindSafe for RaxSet<K>where
K: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more