pub trait ContractStore: Send + Sync {
// Required methods
fn insert(&mut self, contract: StoredContract) -> Result<(), Error>;
fn get_by_script(
&self,
script_pubkey: &Script,
) -> Result<Option<StoredContract>, Error>;
fn list(&self) -> Result<Vec<StoredContract>, Error>;
fn update_state(
&mut self,
script_pubkey: &Script,
state: ContractState,
) -> Result<(), Error>;
}Expand description
Persistence backend for validated StoredContract rows.
Stores are keyed by script pubkey. Higher-level compatibility for built-in same-script templates
is handled by ContractManager, not by individual store implementations.
Required Methods§
fn insert(&mut self, contract: StoredContract) -> Result<(), Error>
fn get_by_script( &self, script_pubkey: &Script, ) -> Result<Option<StoredContract>, Error>
fn list(&self) -> Result<Vec<StoredContract>, Error>
fn update_state( &mut self, script_pubkey: &Script, state: ContractState, ) -> Result<(), Error>
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".