pub trait Map<'a, K: 'a + Copy + Clone + PartialEq + Eq + Hash + Serialize + Deserialize<'a> + Send + Sync, V: 'a + Clone + PartialEq + Eq + Serialize + Deserialize<'a> + Send + Sync>: Clone + MapRead<'a, K, V> + Sync {
    fn insert(&self, key: K, value: V) -> Result<()>;
    fn remove(&self, key: &K) -> Result<()>;
    fn start_atomic(&self);
    fn is_atomic_in_progress(&self) -> bool;
    fn abort_atomic(&self);
    fn finish_atomic(&self) -> Result<()>;
}
Expand description

A trait representing map-like storage operations with read-write capabilities.

Required Methods

Inserts the given key-value pair into the map.

Removes the key-value pair for the given key from the map.

Begins an atomic operation. Any further calls to insert and remove will be queued without an actual write taking place until finish_atomic is called.

Checks whether an atomic operation is currently in progress. This can be done to ensure that lower-level operations don’t start or finish their individual atomic write batch if they are already part of a larger one.

Aborts the current atomic operation.

Finishes an atomic operation, performing all the queued writes.

Implementors