pub struct IdMap<V> {
pub entries: Vec<(TxnId, V)>,
}Expand description
A map from transaction id, stored as a vector sorted by id; vstd
specifies BTreeMap only for keys with an ordering spec, which TxnId
lacks. Serialized as the JSON object the BTreeMap was.
Fields§
§entries: Vec<(TxnId, V)>Sorted by id, ids unique. Read freely; change through the methods.
Implementations§
Source§impl<V> IdMap<V>
impl<V> IdMap<V>
fn find_index(&self, id: &TxnId) -> Result<usize, usize>
pub fn get(&self, id: &TxnId) -> Option<&V>
pub fn contains_key(&self, id: &TxnId) -> bool
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn keys(&self) -> impl DoubleEndedIterator<Item = &TxnId>
pub fn values(&self) -> impl DoubleEndedIterator<Item = &V>
pub fn iter(&self) -> impl DoubleEndedIterator<Item = (&TxnId, &V)>
Trait Implementations§
Source§impl<'de, V: Deserialize<'de>> Deserialize<'de> for IdMap<V>
impl<'de, V: Deserialize<'de>> Deserialize<'de> for IdMap<V>
Source§fn deserialize<D: Deserializer<'de>>(d: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(d: D) -> Result<Self, D::Error>
Deserialize this value from the given Serde deserializer. Read more
impl<V: Eq> Eq for IdMap<V>
impl<V> StructuralPartialEq for IdMap<V>
Auto Trait Implementations§
impl<V> Freeze for IdMap<V>
impl<V> RefUnwindSafe for IdMap<V>where
V: RefUnwindSafe,
impl<V> Send for IdMap<V>where
V: Send,
impl<V> Sync for IdMap<V>where
V: Sync,
impl<V> Unpin for IdMap<V>where
V: Unpin,
impl<V> UnsafeUnpin for IdMap<V>
impl<V> UnwindSafe for IdMap<V>where
V: 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