Struct ExtractIfInner

pub(in ::collections::btree) struct ExtractIfInner<'a, K, V, R> { pub(in ::collections::btree::map) length: &'a mut usize, pub(in ::collections::btree::map) dormant_root: Option<DormantMutRef<'a, NodeRef<Owned, K, V, LeafOrInternal>>>, pub(in ::collections::btree::map) cur_leaf_edge: Option<Handle<NodeRef<Mut<'a>, K, V, Leaf>, Edge>>, pub(in ::collections::btree::map) range: R }

Most of the implementation of ExtractIf are generic over the type of the predicate, thus also serving for BTreeSet::ExtractIf.

Fields

length: &'a mut usize

Reference to the length field in the borrowed map, updated live.

dormant_root: Option<DormantMutRef<'a, NodeRef<Owned, K, V, LeafOrInternal>>>

Buried reference to the root field in the borrowed map. Wrapped in Option to allow drop handler to take it.

cur_leaf_edge: Option<Handle<NodeRef<Mut<'a>, K, V, Leaf>, Edge>>

Contains a leaf edge preceding the next element to be returned, or the last leaf edge. Empty if the map has no root, if iteration went beyond the last leaf edge, or if a panic occurred in the predicate.

range: R

Range over which iteration was requested. We don't need the left side, but we can't extract the right side without requiring K: Clone.

Implementations

impl<'a, K, V, R> ExtractIfInner<'a, K, V, R>

fn peek(&self) -> Option<(&K, &V)>

Allow Debug implementations to predict the next element.

fn next<F, A: Allocator + Clone>(&mut self, pred: &mut F, alloc: A) -> Option<(K, V)>
where
    K: PartialOrd,
    R: RangeBounds<K>,
    F: FnMut(&K, &mut V) -> bool,

Implementation of a typical ExtractIf::next method, given the predicate.

fn size_hint(&self) -> (usize, Option<usize>)

Implementation of a typical ExtractIf::size_hint method.

Auto Trait Implementations

impl<'a, K, V, R> !UnwindSafe for ExtractIfInner<'a, K, V, R>

impl<'a, K, V, R> Freeze for ExtractIfInner<'a, K, V, R> where Option<DormantMutRef<'a, NodeRef<Owned, K, V, LeafOrInternal>>>: Freeze, Option<Handle<NodeRef<Mut<'a>, K, V, Leaf>, Edge>>: Freeze, R: Freeze,

impl<'a, K, V, R> RefUnwindSafe for ExtractIfInner<'a, K, V, R> where Option<DormantMutRef<'a, NodeRef<Owned, K, V, LeafOrInternal>>>: RefUnwindSafe, Option<Handle<NodeRef<Mut<'a>, K, V, Leaf>, Edge>>: RefUnwindSafe, R: RefUnwindSafe,

impl<'a, K, V, R> Send for ExtractIfInner<'a, K, V, R> where Option<DormantMutRef<'a, NodeRef<Owned, K, V, LeafOrInternal>>>: Send, Option<Handle<NodeRef<Mut<'a>, K, V, Leaf>, Edge>>: Send, R: Send,

impl<'a, K, V, R> Sync for ExtractIfInner<'a, K, V, R> where Option<DormantMutRef<'a, NodeRef<Owned, K, V, LeafOrInternal>>>: Sync, Option<Handle<NodeRef<Mut<'a>, K, V, Leaf>, Edge>>: Sync, R: Sync,

impl<'a, K, V, R> Unpin for ExtractIfInner<'a, K, V, R> where Option<DormantMutRef<'a, NodeRef<Owned, K, V, LeafOrInternal>>>: Unpin, Option<Handle<NodeRef<Mut<'a>, K, V, Leaf>, Edge>>: Unpin, R: Unpin,

impl<'a, K, V, R> UnsafeUnpin for ExtractIfInner<'a, K, V, R> where Option<DormantMutRef<'a, NodeRef<Owned, K, V, LeafOrInternal>>>: UnsafeUnpin, Option<Handle<NodeRef<Mut<'a>, K, V, Leaf>, Edge>>: UnsafeUnpin, R: UnsafeUnpin,

Blanket Implementations

impl<T> Any for ExtractIfInner<'a, K, V, R> where T: 'static + ?Sized,

fn type_id(&self) -> TypeId

impl<T> Borrow<T> for ExtractIfInner<'a, K, V, R> where T: ?Sized,

fn borrow(&self) -> &T

impl<T> BorrowMut<T> for ExtractIfInner<'a, K, V, R> where T: ?Sized,

fn borrow_mut(&mut self) -> &mut T

impl<T> From<T> for ExtractIfInner<'a, K, V, R>

fn from(t: T) -> T

Returns the argument unchanged.

impl<T> SizeHint for ExtractIfInner<'a, K, V, R> where T: ?Sized,

fn lower_bound(&self) -> usize
fn upper_bound(&self) -> Option<usize>

impl<T> SizedTypeProperties for ExtractIfInner<'a, K, V, R>

impl<T, U> Into<U> for ExtractIfInner<'a, K, V, R> where U: From<T>,

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of [From]<T> for U chooses to do.

impl<T, U> TryFrom<U> for ExtractIfInner<'a, K, V, R> where U: Into<T>,

type Error = Infallible;
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

impl<T, U> TryInto<U> for ExtractIfInner<'a, K, V, R> where U: TryFrom<T>,

type Error = <U as TryFrom<T>>::Error;
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>