pub struct RemovedEntry<K, T> {
pub key: K,
pub value: T,
pub prev: Option<Ptr>,
pub next: Option<Ptr>,
}
Expand description
Represents an entry that was removed from the linked hash map.
Contains the key-value pair along with the pointers to the previous and next entries in the linked list, allowing for potential reinsertion at the same position.
§Examples
use tether_map::LinkedHashMap;
let mut map = LinkedHashMap::new();
map.insert("key", 42);
let ptr = map.get_ptr(&"key").unwrap();
let removed = map.remove_ptr(ptr).unwrap();
assert_eq!(removed.key, "key");
assert_eq!(removed.value, 42);
Fields§
§key: K
The key of the removed entry
value: T
The value of the removed entry
prev: Option<Ptr>
Pointer to the previous entry in the linked list
next: Option<Ptr>
Pointer to the next entry in the linked list
Trait Implementations§
Source§impl<K: Clone, T: Clone> Clone for RemovedEntry<K, T>
impl<K: Clone, T: Clone> Clone for RemovedEntry<K, T>
Source§fn clone(&self) -> RemovedEntry<K, T>
fn clone(&self) -> RemovedEntry<K, T>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreimpl<K: Copy, T: Copy> Copy for RemovedEntry<K, T>
impl<K: Eq, T: Eq> Eq for RemovedEntry<K, T>
impl<K, T> StructuralPartialEq for RemovedEntry<K, T>
Auto Trait Implementations§
impl<K, T> Freeze for RemovedEntry<K, T>
impl<K, T> RefUnwindSafe for RemovedEntry<K, T>where
K: RefUnwindSafe,
T: RefUnwindSafe,
impl<K, T> Send for RemovedEntry<K, T>
impl<K, T> Sync for RemovedEntry<K, T>
impl<K, T> Unpin for RemovedEntry<K, T>
impl<K, T> UnwindSafe for RemovedEntry<K, T>where
K: UnwindSafe,
T: 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