Skip to main content

EntryMut

Struct EntryMut 

Source
pub struct EntryMut<'map, K, V, const N: usize = DEFAULT_PAGE_CAPACITY> { /* private fields */ }
Expand description

A write guard for an entry in a BLinkMap.

The guard keeps its leaf write-locked. Mutations through DerefMut are visible to later map operations when the guard is dropped.

§Locking

While this guard exists, every other operation targeting the same leaf is blocked—including reads. Drop it before calling back into the map. Acquiring multiple mutable guards in different orders across threads can deadlock.

Implementations§

Source§

impl<K, V, const N: usize> EntryMut<'_, K, V, N>

Source

pub fn key(&self) -> &K

Returns the entry’s immutable key.

Source

pub fn value(&self) -> &V

Returns the entry’s immutable value.

Source

pub fn value_mut(&mut self) -> &mut V

Returns the entry’s value mutably while retaining the leaf write latch.

Trait Implementations§

Source§

impl<K: Debug, V: Debug, const N: usize> Debug for EntryMut<'_, K, V, N>

Source§

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

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

impl<K, V, const N: usize> Deref for EntryMut<'_, K, V, N>

Source§

type Target = V

The resulting type after dereferencing.
Source§

fn deref(&self) -> &V

Dereferences the value.
Source§

impl<K, V, const N: usize> DerefMut for EntryMut<'_, K, V, N>

Source§

fn deref_mut(&mut self) -> &mut V

Mutably dereferences the value.

Auto Trait Implementations§

§

impl<'map, K, V, const N: usize = DEFAULT_PAGE_CAPACITY> !RefUnwindSafe for EntryMut<'map, K, V, N>

§

impl<'map, K, V, const N: usize = DEFAULT_PAGE_CAPACITY> !Send for EntryMut<'map, K, V, N>

§

impl<'map, K, V, const N: usize = DEFAULT_PAGE_CAPACITY> !UnwindSafe for EntryMut<'map, K, V, N>

§

impl<'map, K, V, const N: usize> Freeze for EntryMut<'map, K, V, N>
where ArcRwLockWriteGuard<RawRwLock, Node<K, V, N>>: Freeze, PhantomData<&'map BLinkMap<K, V, N>>: Freeze,

§

impl<'map, K, V, const N: usize> Sync for EntryMut<'map, K, V, N>
where ArcRwLockWriteGuard<RawRwLock, Node<K, V, N>>: Sync, PhantomData<&'map BLinkMap<K, V, N>>: Sync,

§

impl<'map, K, V, const N: usize> Unpin for EntryMut<'map, K, V, N>
where ArcRwLockWriteGuard<RawRwLock, Node<K, V, N>>: Unpin, PhantomData<&'map BLinkMap<K, V, N>>: Unpin,

§

impl<'map, K, V, const N: usize> UnsafeUnpin for EntryMut<'map, K, V, N>
where ArcRwLockWriteGuard<RawRwLock, Node<K, V, N>>: UnsafeUnpin, PhantomData<&'map BLinkMap<K, V, N>>: UnsafeUnpin,

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<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.