Trait ChainInstance

Source
pub trait ChainInstance<State: StateInstance, T> {
    // Required methods
    fn append_delete(&self, txn_id: TxnId, key: Value) -> TCResult<()>;
    fn append_put(
        &self,
        txn: State::Txn,
        key: Value,
        value: State,
    ) -> TCResult<()>;
    fn subject(&self) -> &T;
}
Expand description

Methods common to any type of Chain.

Required Methods§

Source

fn append_delete(&self, txn_id: TxnId, key: Value) -> TCResult<()>

Append the given DELETE op to the latest block in this Chain.

Source

fn append_put(&self, txn: State::Txn, key: Value, value: State) -> TCResult<()>

Append the given PUT op to the latest block in this Chain.

Source

fn subject(&self) -> &T

Borrow the subject of this Chain.

Implementors§

Source§

impl<State, T> ChainInstance<State, T> for Chain<State, State::Txn, State::FE, T>
where State: StateInstance, State::FE: for<'a> FileSave<'a> + CacheBlock, T: Persist<State::FE, Txn = State::Txn> + Route<State> + Debug, Collection<State::Txn, State::FE>: TryCastFrom<State>, Scalar: TryCastFrom<State>,

Source§

impl<State, T> ChainInstance<State, T> for BlockChain<State, State::Txn, State::FE, T>
where State: StateInstance, State::FE: CacheBlock + for<'a> FileSave<'a>, T: Route<State> + Debug, Collection<State::Txn, State::FE>: TryCastFrom<State>, Scalar: TryCastFrom<State>,

Source§

impl<State, T> ChainInstance<State, T> for SyncChain<State, State::Txn, State::FE, T>
where State: StateInstance, State::FE: CacheBlock, T: Persist<State::FE, Txn = State::Txn> + Route<State> + Debug, Collection<State::Txn, State::FE>: TryCastFrom<State>, Scalar: TryCastFrom<State>,