Skip to main content

InnerOccupiedEntry

Struct InnerOccupiedEntry 

Source
pub struct InnerOccupiedEntry<'a, K, V, const PREFIX_LEN: usize = DEFAULT_PREFIX_LEN, A: Allocator = Global> {
    pub(crate) map: &'a mut TreeMap<K, V, PREFIX_LEN, A>,
    pub(crate) key: K,
    pub(crate) overwrite_point: OverwritePoint<K, V, PREFIX_LEN>,
}
Expand description

A view into an occupied subtree in a TreeMap.

It is part of the PrefixOccupied enum.

Fields§

§map: &'a mut TreeMap<K, V, PREFIX_LEN, A>§key: K§overwrite_point: OverwritePoint<K, V, PREFIX_LEN>

Implementations§

Source§

impl<'a, K, V, const PREFIX_LEN: usize, A: Allocator> InnerOccupiedEntry<'a, K, V, PREFIX_LEN, A>
where K: AsBytes,

Source

fn get_leaf(&self) -> Option<NodePtr<PREFIX_LEN, LeafNode<K, V, PREFIX_LEN>>>

Source

pub fn get(&self) -> Option<&V>

Gets a reference to the underlying value if there is only a singular underlying entry.

Source

pub fn get_mut(&mut self) -> Option<&mut V>

Gets a mutable reference to the underlying value if there is only a singular underlying entry.

Source

pub fn get_key(&self) -> Option<&K>

Gets a reference to the underlying key if there is only a singular underlying entry.

Source

pub fn get_key_value_mut(&mut self) -> Option<(&K, &mut V)>

Gets a reference to the underlying key and a mutable reference to the value if there is only a singular underlying entry.

Source

pub fn key(&self) -> &K

Returns a reference to the key that will overwrite the underlying entries.

Source

pub fn iter(&self) -> SubtreeIter<'_, K, V, PREFIX_LEN, A>

Returns an iterator over all key value pairs that would be erased upon insertion.

Source

pub fn iter_mut(&mut self) -> SubtreeIterMut<'_, K, V, PREFIX_LEN, A>

Returns a mutable iterator over all key value pairs that would be erased upon insertion.

Source

pub fn insert(self, value: V) -> &'a mut V

Erase the subtree and insert the value with the previously given key in its place.

Source

pub fn insert_entry(self, value: V) -> OccupiedEntry<'a, K, V, PREFIX_LEN, A>

Erase the subtree and insert the value with the previously given key in its place.

Returns an OccupiedEntry.

Trait Implementations§

Source§

impl<'a, K: Debug, V: Debug, const PREFIX_LEN: usize, A: Debug + Allocator> Debug for InnerOccupiedEntry<'a, K, V, PREFIX_LEN, A>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<K: Send, V: Send, const PREFIX_LEN: usize, A: Send + Allocator> Send for InnerOccupiedEntry<'_, K, V, PREFIX_LEN, A>

Source§

impl<K: Sync, V: Sync, const PREFIX_LEN: usize, A: Sync + Allocator> Sync for InnerOccupiedEntry<'_, K, V, PREFIX_LEN, A>

Auto Trait Implementations§

§

impl<'a, K, V, const PREFIX_LEN: usize, A> Freeze for InnerOccupiedEntry<'a, K, V, PREFIX_LEN, A>
where K: Freeze,

§

impl<'a, K, V, const PREFIX_LEN: usize, A> RefUnwindSafe for InnerOccupiedEntry<'a, K, V, PREFIX_LEN, A>

§

impl<'a, K, V, const PREFIX_LEN: usize, A> Unpin for InnerOccupiedEntry<'a, K, V, PREFIX_LEN, A>
where K: Unpin, V: Unpin,

§

impl<'a, K, V, const PREFIX_LEN: usize, A> UnsafeUnpin for InnerOccupiedEntry<'a, K, V, PREFIX_LEN, A>
where K: UnsafeUnpin,

§

impl<'a, K, V, const PREFIX_LEN: usize = DEFAULT_PREFIX_LEN, A = Global> !UnwindSafe for InnerOccupiedEntry<'a, K, V, PREFIX_LEN, A>

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.