pub trait VEBTree:
Copy
+ Sized
+ Default
+ Debug {
const BITS: usize;
const CAPACITY: usize = _;
const MASK: usize = _;
// Required methods
fn clear(&mut self);
fn is_empty(&self) -> bool;
fn contains(&self, x: usize) -> bool;
fn insert(&mut self, x: usize) -> bool;
fn remove(&mut self, x: usize) -> bool;
fn next(&self, x: usize) -> Option<usize>;
fn prev(&self, x: usize) -> Option<usize>;
fn first(&self) -> Option<usize>;
fn last(&self) -> Option<usize>;
// Provided methods
fn new() -> Self { ... }
fn iter(&self) -> VEBIterator<'_, Self> ⓘ { ... }
}Expand description
Common trait for the different implementations of sets for different sizes.
Required Associated Constants§
Provided Associated Constants§
Required Methods§
Sourcefn insert(&mut self, x: usize) -> bool
fn insert(&mut self, x: usize) -> bool
Adds x to the set.
If the set did not have x present, true is returned.
If the set did have x present, false is returned, and the entry is not updated.
Sourcefn remove(&mut self, x: usize) -> bool
fn remove(&mut self, x: usize) -> bool
If the set contains x, removes it from the set. Returns whether such an element was present.
Sourcefn next(&self, x: usize) -> Option<usize>
fn next(&self, x: usize) -> Option<usize>
Returns the first element in the set that is greater or equal to x, if any.
Sourcefn prev(&self, x: usize) -> Option<usize>
fn prev(&self, x: usize) -> Option<usize>
Returns the last element in the set that is smaller or equal to x, if any.
Provided Methods§
Sourcefn iter(&self) -> VEBIterator<'_, Self> ⓘ
fn iter(&self) -> VEBIterator<'_, Self> ⓘ
Returns an iterator over the values in the set.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.