pub struct CoveringDifferenceView<'a, L, R> { /* private fields */ }Expand description
An immutable view over the covering difference of two TrieViews.
Returned by TrieView::covering_difference. Iterates over every prefix P_l
in the left view for which there is no prefix P_r in the right view satisfying
P_r.len ≤ P_l.len and P_r matching P_l’s leading bits.
Coverage is encoded directly in cov_data / cov_child: a set bit means that L
slot is covered by R and must not be yielded. data_bitmap and child_bitmap are
computed as left_bitmap & !cov_bitmap. The special case where an ancestor R covers
the entire subtrie is represented by cov_data = 0x7FFFFFFF, cov_child = 0xFFFFFFFF
(all 31 data bits and all 32 child bits), which drives both bitmaps to zero.
Trait Implementations§
Source§impl<'a, L, R> AsView<'a> for CoveringDifferenceView<'a, L, R>
impl<'a, L, R> AsView<'a> for CoveringDifferenceView<'a, L, R>
Source§type View = CoveringDifferenceView<'a, L, R>
type View = CoveringDifferenceView<'a, L, R>
view.Source§impl<'a, L, R> IntoIterator for CoveringDifferenceView<'a, L, R>
impl<'a, L, R> IntoIterator for CoveringDifferenceView<'a, L, R>
Source§impl<'a, L, R> TrieView<'a> for CoveringDifferenceView<'a, L, R>
impl<'a, L, R> TrieView<'a> for CoveringDifferenceView<'a, L, R>
Source§fn data_bitmap(&self) -> u32
fn data_bitmap(&self) -> u32
Effective data bitmap: left’s bitmap minus any bits covered by R.
When the entire subtrie is covered (cov_data = 0x7FFFFFFF), this returns 0
because left.data_bitmap() only uses bits 0-30 and !0x7FFFFFFF = 0x80000000.
Source§fn child_bitmap(&self) -> u32
fn child_bitmap(&self) -> u32
Effective child bitmap: left’s bitmap minus any children fully covered by R.
When the entire subtrie is covered (cov_child = 0xFFFFFFFF), this returns 0.
Source§type T = <L as TrieView<'a>>::T
type T = <L as TrieView<'a>>::T
&'a T, &'a mut T, (&'a L, &'a R)).Source§fn key(&self) -> <L::P as Prefix>::R
fn key(&self) -> <L::P as Prefix>::R
prefix_len bits are significant.Source§fn prefix_len(&self) -> u32
fn prefix_len(&self) -> u32
depth <= prefix_len < depth + K).Source§unsafe fn get_child(&mut self, child_bit: u32) -> Self
unsafe fn get_child(&mut self, child_bit: u32) -> Self
child_bit. Read moreSource§unsafe fn reposition(&mut self, key: <L::P as Prefix>::R, prefix_len: u32)
unsafe fn reposition(&mut self, key: <L::P as Prefix>::R, prefix_len: u32)
Source§fn is_non_empty(&self) -> bool
fn is_non_empty(&self) -> bool
Source§fn value(self) -> Option<Self::T>
fn value(self) -> Option<Self::T>
Source§fn prefix_value(self) -> Option<(Self::P, Self::T)>
fn prefix_value(self) -> Option<(Self::P, Self::T)>
Source§fn left(self) -> Option<Self>
fn left(self) -> Option<Self>
None if empty. Read moreSource§fn right(self) -> Option<Self>
fn right(self) -> Option<Self>
None if empty. Read more(target_key, target_len) from this view’s node. Read moreSource§fn find(self, prefix: &Self::P) -> Option<Self>
fn find(self, prefix: &Self::P) -> Option<Self>
prefix and return the view if the sub-trie is non-empty. Read moreSource§fn find_exact(self, prefix: &Self::P) -> Option<Self>
fn find_exact(self, prefix: &Self::P) -> Option<Self>
prefix and return the view only if a value is stored exactly there. Read moreSource§fn find_exact_value(self, prefix: &Self::P) -> Option<(Self::P, Self::T)>
fn find_exact_value(self, prefix: &Self::P) -> Option<(Self::P, Self::T)>
prefix and return its prefix/value pair if a value is stored exactly there. Read moreSource§fn find_lpm(self, prefix: &Self::P) -> Option<Self>where
Self: Clone,
fn find_lpm(self, prefix: &Self::P) -> Option<Self>where
Self: Clone,
prefix. Read moreSource§fn find_lpm_value(self, prefix: &Self::P) -> Option<(Self::P, Self::T)>
fn find_lpm_value(self, prefix: &Self::P) -> Option<(Self::P, Self::T)>
prefix and return its prefix/value pair. Read moreSource§fn iter(self) -> ViewIter<'a, Self> ⓘ
fn iter(self) -> ViewIter<'a, Self> ⓘ
(prefix, value) pairs in this sub-trie. Read moreSource§fn iter_from(self, prefix: &Self::P, inclusive: bool) -> ViewIter<'a, Self> ⓘ
fn iter_from(self, prefix: &Self::P, inclusive: bool) -> ViewIter<'a, Self> ⓘ
Source§fn keys(self) -> ViewKeys<'a, Self> ⓘ
fn keys(self) -> ViewKeys<'a, Self> ⓘ
Source§fn values(self) -> ViewValues<'a, Self> ⓘ
fn values(self) -> ViewValues<'a, Self> ⓘ
Source§fn intersection<R>(
self,
other: R,
) -> Option<IntersectionView<'a, Self, R::View>>
fn intersection<R>( self, other: R, ) -> Option<IntersectionView<'a, Self, R::View>>
Source§fn covering_union<R>(self, other: R) -> CoveringUnionView<'a, Self, R::View> ⓘ
fn covering_union<R>(self, other: R) -> CoveringUnionView<'a, Self, R::View> ⓘ
Source§fn difference<R>(self, other: R) -> DifferenceView<'a, Self, R::View> ⓘ
fn difference<R>(self, other: R) -> DifferenceView<'a, Self, R::View> ⓘ
Source§fn eq_by<R, F>(self, other: R, cmp: F) -> bool
fn eq_by<R, F>(self, other: R, cmp: F) -> bool
self and other contain the same prefixes with equal values,
using cmp to compare each value pair. Read moreSource§fn covering_difference<R>(
self,
other: R,
) -> CoveringDifferenceView<'a, Self, R::View> ⓘ
fn covering_difference<R>( self, other: R, ) -> CoveringDifferenceView<'a, Self, R::View> ⓘ
Auto Trait Implementations§
impl<'a, L, R> Freeze for CoveringDifferenceView<'a, L, R>
impl<'a, L, R> RefUnwindSafe for CoveringDifferenceView<'a, L, R>where
L: RefUnwindSafe,
R: RefUnwindSafe,
impl<'a, L, R> Send for CoveringDifferenceView<'a, L, R>
impl<'a, L, R> Sync for CoveringDifferenceView<'a, L, R>
impl<'a, L, R> Unpin for CoveringDifferenceView<'a, L, R>
impl<'a, L, R> UnsafeUnpin for CoveringDifferenceView<'a, L, R>where
L: UnsafeUnpin,
R: UnsafeUnpin,
impl<'a, L, R> UnwindSafe for CoveringDifferenceView<'a, L, R>where
L: UnwindSafe,
R: 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
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>
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>
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