rustc_data_structures::snapshot_map

Type Alias SnapshotMapRef

Source
pub type SnapshotMapRef<'a, K, V, L> = SnapshotMap<K, V, &'a mut FxHashMap<K, V>, &'a mut L>;

Aliased Type§

struct SnapshotMapRef<'a, K, V, L> {
    map: &'a mut HashMap<K, V, FxBuildHasher>,
    undo_log: &'a mut L,
    _marker: PhantomData<(K, V)>,
}

Fields§

§map: &'a mut HashMap<K, V, FxBuildHasher>§undo_log: &'a mut L§_marker: PhantomData<(K, V)>

Layout§

Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...) attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.

Size: 16 bytes

Implementations

Source§

impl<K, V, M, L> SnapshotMap<K, V, M, L>

Source

pub fn with_log<L2>(&mut self, undo_log: L2) -> SnapshotMap<K, V, &mut M, L2>

Source§

impl<K, V, M, L> SnapshotMap<K, V, M, L>
where K: Hash + Clone + Eq, M: BorrowMut<FxHashMap<K, V>> + Borrow<FxHashMap<K, V>>, L: UndoLogs<UndoLog<K, V>>,

Source

pub fn clear(&mut self)

Source

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

Source

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

Source

pub fn get(&self, key: &K) -> Option<&V>

Trait Implementations

Source§

impl<K: Clone, V: Clone, M: Clone, L: Clone> Clone for SnapshotMap<K, V, M, L>

Source§

fn clone(&self) -> SnapshotMap<K, V, M, L>

Returns a copy of the value. Read more
Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<K, V, M, L> Default for SnapshotMap<K, V, M, L>
where M: Default, L: Default,

Source§

fn default() -> Self

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

impl<'k, K, V, M, L> Index<&'k K> for SnapshotMap<K, V, M, L>
where K: Hash + Clone + Eq, M: Borrow<FxHashMap<K, V>>,

Source§

type Output = V

The returned type after indexing.
Source§

fn index(&self, key: &'k K) -> &V

Performs the indexing (container[index]) operation. Read more
Source§

impl<K, V, M, L> Rollback<UndoLog<K, V>> for SnapshotMap<K, V, M, L>
where K: Eq + Hash, M: Rollback<UndoLog<K, V>>,

Source§

fn reverse(&mut self, undo: UndoLog<K, V>)