pub trait ContractSpec:
Clone
+ Serialize
+ for<'de> Deserialize<'de>
+ Send
+ Sync
+ 'static {
const VERSION: u32;
// Required methods
fn contract_type() -> ContractType;
fn script_pubkey(&self, ctx: &ContractContext) -> Result<ScriptBuf, Error>;
fn spendable_paths(
&self,
ctx: &ContractContext,
) -> Result<Vec<SpendPath>, Error>;
// Provided method
fn spendable_selections(
&self,
ctx: &ContractContext,
) -> Result<Vec<SpendSelection>, Error> { ... }
}Required Associated Constants§
Required Methods§
fn contract_type() -> ContractType
fn script_pubkey(&self, ctx: &ContractContext) -> Result<ScriptBuf, Error>
fn spendable_paths( &self, ctx: &ContractContext, ) -> Result<Vec<SpendPath>, Error>
Provided Methods§
fn spendable_selections( &self, ctx: &ContractContext, ) -> Result<Vec<SpendSelection>, Error>
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".