pub struct DifferenceView<'a, L, R> { /* private fields */ }Expand description
An immutable view over the difference of two TrieViews.
Returned by TrieView::difference. Iterates over every prefix present
in the left view but not in the right view, yielding values from the left side.
The right side is Option<R> internally: once the traversal enters a subtree
that the right view does not cover, the right side becomes None and all
remaining left entries in that subtree are yielded unconditionally.
Trait Implementations§
Source§impl<'a, L, R> AsView<'a> for DifferenceView<'a, L, R>
impl<'a, L, R> AsView<'a> for DifferenceView<'a, L, R>
Source§type View = DifferenceView<'a, L, R>
type View = DifferenceView<'a, L, R>
The concrete view type returned by
view.Source§impl<'a, L, R> IntoIterator for DifferenceView<'a, L, R>
impl<'a, L, R> IntoIterator for DifferenceView<'a, L, R>
Source§impl<'a, L, R> TrieView<'a> for DifferenceView<'a, L, R>
impl<'a, L, R> TrieView<'a> for DifferenceView<'a, L, R>
Source§type T = <L as TrieView<'a>>::T
type T = <L as TrieView<'a>>::T
The value type yielded by this view (e.g.
&'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
Accumulated key bits; only the top
prefix_len bits are significant.Source§fn prefix_len(&self) -> u32
fn prefix_len(&self) -> u32
Binary-tree depth of this view’s root position (
depth <= prefix_len < depth + K).Source§fn data_bitmap(&self) -> u32
fn data_bitmap(&self) -> u32
Effective data bitmap (node bitmap ANDed with cover mask and any set-op filter). Read more
Source§fn child_bitmap(&self) -> u32
fn child_bitmap(&self) -> u32
Effective child bitmap (node bitmap ANDed with cover mask and any set-op filter). Read more
Source§unsafe fn get_child(&mut self, child_bit: u32) -> Self
unsafe fn get_child(&mut self, child_bit: u32) -> Self
Return a child view at
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)
Move the cursor to a different location within the same multibit-node. Read more
Source§fn is_non_empty(&self) -> bool
fn is_non_empty(&self) -> bool
Whether the sub-trie rooted at this view position is non-empty. Read more
Source§fn value(self) -> Option<Self::T>
fn value(self) -> Option<Self::T>
Return the value stored exactly at this view’s root position, if any. Read more
Source§fn prefix_value(self) -> Option<(Self::P, Self::T)>
fn prefix_value(self) -> Option<(Self::P, Self::T)>
Return the prefix and value stored exactly at this view’s root position, if any. Read more
Source§fn left(self) -> Option<Self>
fn left(self) -> Option<Self>
Return a view into the left (0-bit) child sub-trie, or
None if empty. Read moreSource§fn right(self) -> Option<Self>
fn right(self) -> Option<Self>
Return a view into the right (1-bit) child sub-trie, or
None if empty. Read moreNavigate toward
(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>
Navigate to
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>
Navigate to
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)>
Navigate to
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,
Find the view pointing at the longest prefix match for
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)>
Find the longest prefix match for
prefix and return its prefix/value pair. Read moreSource§fn iter(self) -> ViewIter<'a, Self> ⓘ
fn iter(self) -> ViewIter<'a, Self> ⓘ
Return an iterator over all
(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> ⓘ
Return an iterator starting at the given prefix in lexicographic order. Read more
Source§fn keys(self) -> ViewKeys<'a, Self> ⓘ
fn keys(self) -> ViewKeys<'a, Self> ⓘ
Return an iterator over all prefixes in this sub-trie. Read more
Source§fn values(self) -> ViewValues<'a, Self> ⓘ
fn values(self) -> ViewValues<'a, Self> ⓘ
Return an iterator over all values in this sub-trie. Read more
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
Check whether
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 DifferenceView<'a, L, R>
impl<'a, L, R> RefUnwindSafe for DifferenceView<'a, L, R>where
L: RefUnwindSafe,
R: RefUnwindSafe,
impl<'a, L, R> Send for DifferenceView<'a, L, R>
impl<'a, L, R> Sync for DifferenceView<'a, L, R>
impl<'a, L, R> Unpin for DifferenceView<'a, L, R>
impl<'a, L, R> UnsafeUnpin for DifferenceView<'a, L, R>where
L: UnsafeUnpin,
R: UnsafeUnpin,
impl<'a, L, R> UnwindSafe for DifferenceView<'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
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