[−][src]Struct transact::state::hashmap::HashMapState
An in-memory implementation of state.
Stores a series of individual State
s in a collective HashMap
, where each
individual state HashMap
is stored by its ID. No individual State
gets modified on
updates, a new State
is simply inserted into States
.
Methods
impl HashMapState
[src]
pub fn new() -> Self
[src]
Create a new HashMapState.
Adds the empty state as a starting state.
pub fn state_id(state: &State) -> String
[src]
Calculate the ID of the given state.
Trait Implementations
impl Write for HashMapState
[src]
type StateId = String
A reference to a checkpoint in state. It could be a merkle hash for a merkle database. Read more
type Key = String
The Key that is being stored in state.
type Value = Vec<u8>
The Value that is being stored in state.
fn commit(
&self,
state_id: &Self::StateId,
state_changes: &[StateChange]
) -> Result<Self::StateId, StateWriteError>
[src]
&self,
state_id: &Self::StateId,
state_changes: &[StateChange]
) -> Result<Self::StateId, StateWriteError>
fn compute_state_id(
&self,
state_id: &Self::StateId,
state_changes: &[StateChange]
) -> Result<Self::StateId, StateWriteError>
[src]
&self,
state_id: &Self::StateId,
state_changes: &[StateChange]
) -> Result<Self::StateId, StateWriteError>
impl Read for HashMapState
[src]
type StateId = String
A reference to a checkpoint in state. It could be a merkle hash for a merkle database. Read more
type Key = String
The Key that is being stored in state.
type Value = Vec<u8>
The Value that is being stored in state.
fn get(
&self,
state_id: &Self::StateId,
keys: &[Self::Key]
) -> Result<State, StateReadError>
[src]
&self,
state_id: &Self::StateId,
keys: &[Self::Key]
) -> Result<State, StateReadError>
fn clone_box(
&self
) -> Box<dyn Read<StateId = String, Key = String, Value = Vec<u8>>>
[src]
&self
) -> Box<dyn Read<StateId = String, Key = String, Value = Vec<u8>>>
impl Default for HashMapState
[src]
fn default() -> HashMapState
[src]
impl Clone for HashMapState
[src]
fn clone(&self) -> HashMapState
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for HashMapState
[src]
Auto Trait Implementations
impl Send for HashMapState
impl Unpin for HashMapState
impl Sync for HashMapState
impl UnwindSafe for HashMapState
impl RefUnwindSafe for HashMapState
Blanket Implementations
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> SafeBorrow<T> for T where
T: ?Sized,
T: ?Sized,
fn borrow_replacement(ptr: &T) -> &T
impl<'a, T> DefaultFeatures<'a> for T where
T: 'a + Send + Sync + Clone,
T: 'a + Send + Sync + Clone,
fn clone_boxed(&self) -> Box<dyn DefaultFeatures<'a> + 'a>
fn self_address_mut(&mut self) -> *mut ()
impl<'a, T> NonSyncFeatures<'a> for T where
T: 'a + Clone,
T: 'a + Clone,
fn clone_boxed(&self) -> Box<dyn NonSyncFeatures<'a> + 'a>
fn self_address_mut(&mut self) -> *mut ()
impl<T> Same<T> for T
type Output = T
Should always be Self