pub trait Set<T> {
type SelectCursor<'b>: SelectCursor<T>
where Self: 'b;
// Required methods
fn contains(&self, el: T) -> bool;
fn rank(&self, el: T) -> T;
fn rank_if_exists(&self, el: T) -> Option<T>;
fn select(&self, rank: T) -> T;
fn select_cursor(&self) -> Self::SelectCursor<'_>;
}
Required Associated Types§
type SelectCursor<'b>: SelectCursor<T> where Self: 'b
Required Methods§
Sourcefn rank_if_exists(&self, el: T) -> Option<T>
fn rank_if_exists(&self, el: T) -> Option<T>
If the set contains el
returns the element rank.
If the set does not contain the element, it returns None
.
Sourcefn select(&self, rank: T) -> T
fn select(&self, rank: T) -> T
Return the rank-th value stored in this bitmap.
§Panics
May panic if rank is greater or equal to the number of elements in the Set.
Sourcefn select_cursor(&self) -> Self::SelectCursor<'_>
fn select_cursor(&self) -> Self::SelectCursor<'_>
Creates a brand new select cursor.
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.