pub trait SplinterRead {
// Required methods
fn is_empty(&self) -> bool;
fn contains(&self, key: u32) -> bool;
fn cardinality(&self) -> usize;
fn iter(&self) -> impl Iterator<Item = u32> + '_;
fn range<'a, R>(&'a self, range: R) -> impl Iterator<Item = u32> + 'a
where R: RangeBounds<u32> + 'a;
fn last(&self) -> Option<u32>;
}Required Methods§
Sourcefn is_empty(&self) -> bool
fn is_empty(&self) -> bool
Returns true if the Splinter is empty.
§Examples
let mut splinter = Splinter::default();
assert!(splinter.is_empty());
splinter.insert(1);
assert!(!splinter.is_empty());Sourcefn contains(&self, key: u32) -> bool
fn contains(&self, key: u32) -> bool
Returns true if the Splinter contains the given key.
§Examples
let mut splinter = Splinter::default();
splinter.insert(1);
splinter.insert(3);
assert!(splinter.contains(1));
assert!(!splinter.contains(2));
assert!(splinter.contains(3));Sourcefn cardinality(&self) -> usize
fn cardinality(&self) -> usize
Calculates the total number of values stored in the Splinter.
§Examples
let mut splinter = Splinter::default();
splinter.insert(6);
splinter.insert(1);
splinter.insert(3);
assert_eq!(3, splinter.cardinality());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.