Skip to main content

StateWriteProvider

Trait StateWriteProvider 

Source
pub trait StateWriteProvider: StoreTransaction<TransactionErr = Self::Error> {
    type ContractWrite<'a>: ContractStateWrite<Error = Self::Error>
       where Self: 'a;
    type Error: Error;

    // Required methods
    fn register_contract(
        &mut self,
        schema: &Schema,
        genesis: &Genesis,
    ) -> Result<Self::ContractWrite<'_>, Self::Error>;
    fn update_contract(
        &mut self,
        contract_id: ContractId,
    ) -> Result<Option<Self::ContractWrite<'_>>, Self::Error>;
    fn upsert_witness(
        &mut self,
        witness_id: Txid,
        witness_ord: WitnessOrd,
    ) -> Result<(), Self::Error>;
    fn update_op(&mut self, opid: OpId, valid: bool) -> Result<(), Self::Error>;
}

Required Associated Types§

Source

type ContractWrite<'a>: ContractStateWrite<Error = Self::Error> where Self: 'a

Source

type Error: Error

Required Methods§

Source

fn register_contract( &mut self, schema: &Schema, genesis: &Genesis, ) -> Result<Self::ContractWrite<'_>, Self::Error>

Source

fn update_contract( &mut self, contract_id: ContractId, ) -> Result<Option<Self::ContractWrite<'_>>, Self::Error>

Source

fn upsert_witness( &mut self, witness_id: Txid, witness_ord: WitnessOrd, ) -> Result<(), Self::Error>

Source

fn update_op(&mut self, opid: OpId, valid: bool) -> Result<(), Self::Error>

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl StateWriteProvider for MemState

Source§

type ContractWrite<'a> = MemContractWriter<'a>

Source§

type Error = MemError