pub struct SplinterRef<T> { /* private fields */ }
Expand description
A compressed bitmap for u32 keys operating directly on a slice of bytes
Implementations§
Source§impl<T> SplinterRef<T>
impl<T> SplinterRef<T>
pub fn inner(&self) -> &T
pub fn into_inner(self) -> T
Trait Implementations§
Source§impl<T: Clone> Clone for SplinterRef<T>
impl<T: Clone> Clone for SplinterRef<T>
Source§fn clone(&self) -> SplinterRef<T>
fn clone(&self) -> SplinterRef<T>
Returns a duplicate of the value. Read more
1.0.0 · Source§const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl<T1: AsRef<[u8]>, T2: AsRef<[u8]>> Cut<SplinterRef<T2>> for CowSplinter<T1>
impl<T1: AsRef<[u8]>, T2: AsRef<[u8]>> Cut<SplinterRef<T2>> for CowSplinter<T1>
Source§impl From<CowSplinter<Bytes>> for SplinterRef<Bytes>
impl From<CowSplinter<Bytes>> for SplinterRef<Bytes>
Source§fn from(cow: CowSplinter<Bytes>) -> Self
fn from(cow: CowSplinter<Bytes>) -> Self
Converts to this type from the input type.
Source§impl<B> From<SplinterRef<B>> for CowSplinter<B>
impl<B> From<SplinterRef<B>> for CowSplinter<B>
Source§fn from(splinter_ref: SplinterRef<B>) -> Self
fn from(splinter_ref: SplinterRef<B>) -> Self
Converts to this type from the input type.
Source§impl<T: AsRef<[u8]>> From<SplinterRef<T>> for Splinter
impl<T: AsRef<[u8]>> From<SplinterRef<T>> for Splinter
Source§fn from(value: SplinterRef<T>) -> Self
fn from(value: SplinterRef<T>) -> Self
Converts to this type from the input type.
Source§impl<T: AsRef<[u8]>> Intersection<Splinter> for SplinterRef<T>
impl<T: AsRef<[u8]>> Intersection<Splinter> for SplinterRef<T>
Source§impl<T: AsRef<[u8]>> Intersection<SplinterRef<T>> for Splinter
impl<T: AsRef<[u8]>> Intersection<SplinterRef<T>> for Splinter
type Output = Splinter
Source§fn intersection(&self, rhs: &SplinterRef<T>) -> Self::Output
fn intersection(&self, rhs: &SplinterRef<T>) -> Self::Output
Returns the intersection between self and other
Source§impl<T1: AsRef<[u8]>, T2: AsRef<[u8]>> Intersection<SplinterRef<T2>> for CowSplinter<T1>
impl<T1: AsRef<[u8]>, T2: AsRef<[u8]>> Intersection<SplinterRef<T2>> for CowSplinter<T1>
type Output = Splinter
Source§fn intersection(&self, rhs: &SplinterRef<T2>) -> Self::Output
fn intersection(&self, rhs: &SplinterRef<T2>) -> Self::Output
Returns the intersection between self and other
Source§impl<T1: AsRef<[u8]>, T2: AsRef<[u8]>> Intersection<SplinterRef<T2>> for SplinterRef<T1>
impl<T1: AsRef<[u8]>, T2: AsRef<[u8]>> Intersection<SplinterRef<T2>> for SplinterRef<T1>
type Output = Splinter
Source§fn intersection(&self, rhs: &SplinterRef<T2>) -> Self::Output
fn intersection(&self, rhs: &SplinterRef<T2>) -> Self::Output
Returns the intersection between self and other
Source§impl<T: AsRef<[u8]>> Merge<SplinterRef<T>> for Splinter
impl<T: AsRef<[u8]>> Merge<SplinterRef<T>> for Splinter
Source§fn merge(&mut self, rhs: &SplinterRef<T>)
fn merge(&mut self, rhs: &SplinterRef<T>)
Merges rhs into self
Source§impl<T1: AsRef<[u8]>, T2: AsRef<[u8]>> Merge<SplinterRef<T2>> for CowSplinter<T1>
impl<T1: AsRef<[u8]>, T2: AsRef<[u8]>> Merge<SplinterRef<T2>> for CowSplinter<T1>
Source§fn merge(&mut self, rhs: &SplinterRef<T2>)
fn merge(&mut self, rhs: &SplinterRef<T2>)
Merges rhs into self
Source§impl<T1: AsRef<[u8]>, T2: AsRef<[u8]>> PartialEq<CowSplinter<T2>> for SplinterRef<T1>
impl<T1: AsRef<[u8]>, T2: AsRef<[u8]>> PartialEq<CowSplinter<T2>> for SplinterRef<T1>
Source§impl<T1: AsRef<[u8]>, T2: AsRef<[u8]>> PartialEq<SplinterRef<T2>> for CowSplinter<T1>
impl<T1: AsRef<[u8]>, T2: AsRef<[u8]>> PartialEq<SplinterRef<T2>> for CowSplinter<T1>
Source§impl<T1: AsRef<[u8]>, T2: AsRef<[u8]>> PartialEq<SplinterRef<T2>> for SplinterRef<T1>
impl<T1: AsRef<[u8]>, T2: AsRef<[u8]>> PartialEq<SplinterRef<T2>> for SplinterRef<T1>
Source§impl<T: AsRef<[u8]>> SplinterRead for SplinterRef<T>
impl<T: AsRef<[u8]>> SplinterRead for SplinterRef<T>
Source§fn is_empty(&self) -> bool
fn is_empty(&self) -> bool
Returns true
if the splinter is empty.
§Examples
let mut splinter = Splinter::default().serialize_to_splinter_ref();
assert!(splinter.is_empty());
let mut splinter = Splinter::default();
splinter.insert(1);
let splinter = splinter.serialize_to_splinter_ref();
assert!(!splinter.is_empty());
Source§fn 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);
let splinter = splinter.serialize_to_splinter_ref();
assert!(splinter.contains(1));
assert!(!splinter.contains(2));
assert!(splinter.contains(3));
Source§fn cardinality(&self) -> usize
fn cardinality(&self) -> usize
Calculates the total number of values stored in the set.
§Examples
let mut splinter = Splinter::default();
splinter.insert(6);
splinter.insert(1);
splinter.insert(3);
let splinter = splinter.serialize_to_splinter_ref();
assert_eq!(3, splinter.cardinality());
Source§fn range<'a, R>(&'a self, range: R) -> impl Iterator<Item = u32> + 'awhere
R: RangeBounds<u32> + 'a,
fn range<'a, R>(&'a self, range: R) -> impl Iterator<Item = u32> + 'awhere
R: RangeBounds<u32> + 'a,
Returns an sorted Iterator
over all keys contained by the provided range.
§Examples
let mut splinter = Splinter::default();
splinter.insert(6);
splinter.insert(1);
splinter.insert(3);
splinter.insert(5);
splinter.insert(9);
let splinter = splinter.serialize_to_splinter_ref();
assert_eq!(&[3, 5, 6], &*splinter.range(3..=6).collect::<Vec<_>>());
Source§impl<T1: AsRef<[u8]>, T2: AsRef<[u8]>> Union<SplinterRef<T2>> for CowSplinter<T1>
impl<T1: AsRef<[u8]>, T2: AsRef<[u8]>> Union<SplinterRef<T2>> for CowSplinter<T1>
Source§impl<T1, T2> Union<SplinterRef<T2>> for SplinterRef<T1>
impl<T1, T2> Union<SplinterRef<T2>> for SplinterRef<T1>
impl<T1: AsRef<[u8]>> Eq for SplinterRef<T1>
Auto Trait Implementations§
impl<T> Freeze for SplinterRef<T>where
T: Freeze,
impl<T> RefUnwindSafe for SplinterRef<T>where
T: RefUnwindSafe,
impl<T> Send for SplinterRef<T>where
T: Send,
impl<T> Sync for SplinterRef<T>where
T: Sync,
impl<T> Unpin for SplinterRef<T>where
T: Unpin,
impl<T> UnwindSafe for SplinterRef<T>where
T: 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more