KdValueMapImpl

Struct KdValueMapImpl 

Source
pub struct KdValueMapImpl<K, V, Node, Balance: TreeHeightBound = Ratio<5, 4>>
where V: KdValue, Node: KdNode<Value = KdValuePlus<V, K>>,
{ /* private fields */ }

Implementations§

Source§

impl<K, V, Node, Balance> KdValueMapImpl<K, V, Node, Balance>
where K: Clone + Eq + Hash, V: KdValue, Node: KdNode<Value = KdValuePlus<V, K>>, Balance: TreeHeightBound,

Source

pub fn new() -> Self
where Balance: Default,

Source

pub fn with_balance(balance: Balance) -> Self

Source

pub fn len(&self) -> usize

Source

pub fn is_empty(&self) -> bool

Source

pub fn clear(&mut self)

Source

pub fn contains_key(&mut self, key: &K) -> bool

Source

pub fn keys(&self) -> impl Iterator<Item = &K>

Source

pub fn into_keys(self) -> impl Iterator<Item = K>

Source

pub fn values(&self) -> impl Iterator<Item = &V>

Source§

impl<K, V, Node, Balance> KdValueMapImpl<K, V, Node, Balance>
where K: Clone + Eq + Hash, V: KdValue, Node: KdNode<Value = KdValuePlus<V, K>>, Node::Ownership: Consumable<Value = KdValuePlus<V, K>>, Balance: TreeHeightBound,

Source

pub fn drain(self) -> impl Iterator<Item = (K, V)>

Source

pub fn into_values(self) -> impl Iterator<Item = V>

Source§

impl<K, V, Stat, Node, Balance> KdValueMapImpl<K, V, Node, Balance>
where K: Clone + Eq + Hash, V: KdValue, Stat: Height, Node: ScapegoatKdNode<Value = KdValuePlus<V, K>> + Parent + Statistic<Stat = Stat>, <Node as Ownable>::Ownership: KdInsertable<Node> + Consumable<Value = KdValuePlus<V, K>>, Balance: TreeHeightBound,

Source

pub fn insert(&mut self, key: K, value: V) -> Option<V>

Source

pub fn try_insert(&mut self, key: K, value: V) -> Result<(), &V>

Source

pub fn remove<BK: Borrow<K>>(&mut self, key: BK) -> Option<V>

Source§

impl<K, V, Stat, Node, Balance> KdValueMapImpl<K, V, Node, Balance>
where V: KdValue, Stat: Default, Node: KdSearchable<KdValuePlus<V, K>, WithHeight<Stat>> + KdNode<Value = KdValuePlus<V, K>> + Statistic<Stat = WithHeight<Stat>>, Balance: TreeHeightBound,

Source

pub fn search_values_with<S>(&self, searcher: &mut S)
where S: KdSearcher<KdValuePlus<V, K>, Stat>,

Source

pub fn search_values<S>(&self, searcher: S) -> S
where S: KdSearcher<KdValuePlus<V, K>, Stat>,

Trait Implementations§

Source§

impl<K, V, Node, Balance> Default for KdValueMapImpl<K, V, Node, Balance>
where V: KdValue, Node: KdNode<Value = KdValuePlus<V, K>>, Balance: TreeHeightBound + Default,

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<K, V, Node, Balance> FromIterator<(K, V)> for KdValueMapImpl<K, V, Node, Balance>
where K: Clone + Eq + Hash, V: KdValue, Node: KdBuildableNode<Value = KdValuePlus<V, K>>, <Node as Ownable>::Ownership: KdInsertable<Node>, Balance: TreeHeightBound,

Source§

fn from_iter<Is>(items: Is) -> Self
where Is: IntoIterator<Item = (K, V)>,

Creates a value from an iterator. Read more
Source§

impl<'a, K, V, Node, Balance> IntoIterator for &'a KdValueMapImpl<K, V, Node, Balance>
where K: 'a + Clone + Eq + Hash, V: 'a + KdValue, Node: KdNode<Value = KdValuePlus<V, K>>, Balance: TreeHeightBound,

Source§

type Item = (&'a K, &'a V)

The type of the elements being iterated over.
Source§

type IntoIter = KdValueIterator<'a, K, V, Node>

Which kind of iterator are we turning this into?
Source§

fn into_iter(self) -> KdValueIterator<'a, K, V, Node>

Creates an iterator from a value. Read more

Auto Trait Implementations§

§

impl<K, V, Node, Balance> Freeze for KdValueMapImpl<K, V, Node, Balance>
where <Node as KdNode>::Tree: Freeze, Balance: Freeze,

§

impl<K, V, Node, Balance> RefUnwindSafe for KdValueMapImpl<K, V, Node, Balance>
where <Node as KdNode>::Tree: RefUnwindSafe, Balance: RefUnwindSafe, K: RefUnwindSafe, Node: RefUnwindSafe,

§

impl<K, V, Node, Balance = Ratio<5, 4>> !Send for KdValueMapImpl<K, V, Node, Balance>

§

impl<K, V, Node, Balance = Ratio<5, 4>> !Sync for KdValueMapImpl<K, V, Node, Balance>

§

impl<K, V, Node, Balance> Unpin for KdValueMapImpl<K, V, Node, Balance>
where <Node as KdNode>::Tree: Unpin, Balance: Unpin, K: Unpin,

§

impl<K, V, Node, Balance> UnwindSafe for KdValueMapImpl<K, V, Node, Balance>
where <Node as KdNode>::Tree: UnwindSafe, Balance: UnwindSafe, K: UnwindSafe, Node: RefUnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.