pub struct RTrieSet<P: IpPrefix>(_);Expand description
A set of Ip prefixes based on a radix binary trie
Implementations§
source§impl<P: IpPrefix> RTrieSet<P>
impl<P: IpPrefix> RTrieSet<P>
pub fn new() -> Self
pub fn len(&self) -> NonZeroUsize
pub fn compress(self) -> LCTrieSet<P>
pub fn with_capacity(capacity: usize) -> Self
pub fn insert(&mut self, k: P) -> bool
pub fn contains<Q>(&self, k: &Q) -> boolwhere Q: IpPrefix<Addr = P::Addr>, P: IpPrefixCovering<Q>,
pub fn remove<Q>(&mut self, k: &Q) -> boolwhere Q: IpPrefix<Addr = P::Addr>, P: IpPrefixCovering<Q>,
pub fn replace(&mut self, k: P) -> Option<P>
pub fn lookup<Q>(&self, k: &Q) -> &Pwhere Q: IpPrefix<Addr = P::Addr>, P: IpPrefixCovering<Q>,
pub fn iter(&self) -> impl Iterator<Item = &P> + '_
Trait Implementations§
source§impl<P: IpPrefix> Extend<P> for RTrieSet<P>
impl<P: IpPrefix> Extend<P> for RTrieSet<P>
source§fn extend<I: IntoIterator<Item = P>>(&mut self, iter: I)
fn extend<I: IntoIterator<Item = P>>(&mut self, iter: I)
Extends a collection with the contents of an iterator. Read more
source§fn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
🔬This is a nightly-only experimental API. (
extend_one)Extends a collection with exactly one element.
source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
🔬This is a nightly-only experimental API. (
extend_one)Reserves capacity in a collection for the given number of additional elements. Read more
source§impl<P: IpPrefix> FromIterator<P> for RTrieSet<P>
impl<P: IpPrefix> FromIterator<P> for RTrieSet<P>
source§fn from_iter<I: IntoIterator<Item = P>>(iter: I) -> Self
fn from_iter<I: IntoIterator<Item = P>>(iter: I) -> Self
Creates a value from an iterator. Read more
Auto Trait Implementations§
impl<P> RefUnwindSafe for RTrieSet<P>where P: RefUnwindSafe,
impl<P> Send for RTrieSet<P>where P: Send,
impl<P> Sync for RTrieSet<P>where P: Sync,
impl<P> Unpin for RTrieSet<P>where P: Unpin,
impl<P> UnwindSafe for RTrieSet<P>where P: 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