Trait Inventory

Source
pub trait Inventory: Deref<Target = Self::Stash> {
    type Stash: Stash;
    type Error: Error;

Show 27 methods // Required methods fn stash(&self) -> &Self::Stash; fn import_sigs<I>( &mut self, content_id: ContentId, sigs: I, ) -> Result<(), InventoryDataError<Self::Error>> where I: IntoIterator<Item = Cert>, I::IntoIter: ExactSizeIterator<Item = Cert>; fn import_schema( &mut self, schema: impl Into<Bindle<SubSchema>>, ) -> Result<Status, InventoryDataError<Self::Error>>; fn import_iface( &mut self, iface: impl Into<Bindle<Iface>>, ) -> Result<Status, InventoryDataError<Self::Error>>; fn import_iface_impl( &mut self, iimpl: impl Into<Bindle<IfaceImpl>>, ) -> Result<Status, InventoryDataError<Self::Error>>; fn import_contract<R: ResolveHeight>( &mut self, contract: Contract, resolver: &mut R, ) -> Result<Status, InventoryError<Self::Error>> where R::Error: 'static; fn accept_transfer<R: ResolveHeight>( &mut self, transfer: Transfer, resolver: &mut R, force: bool, ) -> Result<Status, InventoryError<Self::Error>> where R::Error: 'static; fn consume_anchor( &mut self, anchor: Anchor<MerkleBlock>, ) -> Result<(), InventoryError<Self::Error>>; fn consume_bundle( &mut self, contract_id: ContractId, bundle: TransitionBundle, witness_txid: Txid, ) -> Result<(), InventoryError<Self::Error>>; unsafe fn import_contract_force<R: ResolveHeight>( &mut self, contract: Contract, resolver: &mut R, ) -> Result<Status, InventoryError<Self::Error>> where R::Error: 'static; fn contract_iface( &mut self, contract_id: ContractId, iface_id: IfaceId, ) -> Result<ContractIface, InventoryError<Self::Error>>; fn anchored_bundle( &self, opid: OpId, ) -> Result<AnchoredBundle, InventoryError<Self::Error>>; fn transition( &self, opid: OpId, ) -> Result<&Transition, InventoryError<Self::Error>>; fn contracts_by_outpoints( &mut self, outpoints: impl IntoIterator<Item = impl Into<Outpoint>>, ) -> Result<BTreeSet<ContractId>, InventoryError<Self::Error>>; fn public_opouts( &mut self, contract_id: ContractId, ) -> Result<BTreeSet<Opout>, InventoryError<Self::Error>>; fn opouts_by_outpoints( &mut self, contract_id: ContractId, outpoints: impl IntoIterator<Item = impl Into<Outpoint>>, ) -> Result<BTreeSet<Opout>, InventoryError<Self::Error>>; fn opouts_by_terminals( &mut self, terminals: impl IntoIterator<Item = SecretSeal>, ) -> Result<BTreeSet<Opout>, InventoryError<Self::Error>>; fn state_for_outpoints( &mut self, contract_id: ContractId, outpoints: impl IntoIterator<Item = impl Into<Outpoint>>, ) -> Result<BTreeMap<Opout, TypedState>, InventoryError<Self::Error>>; fn store_seal_secret( &mut self, seal: GraphSeal, ) -> Result<(), InventoryError<Self::Error>>; fn seal_secrets( &mut self, ) -> Result<BTreeSet<GraphSeal>, InventoryError<Self::Error>>; // Provided methods fn contracts_with_iface( &mut self, iface: impl Into<TypeName>, ) -> Result<Vec<ContractIface>, InventoryError<Self::Error>> where Self::Error: From<<Self::Stash as Stash>::Error>, InventoryError<Self::Error>: From<<Self::Stash as Stash>::Error> { ... } fn contract_iface_named( &mut self, contract_id: ContractId, iface: impl Into<TypeName>, ) -> Result<ContractIface, InventoryError<Self::Error>> where Self::Error: From<<Self::Stash as Stash>::Error>, InventoryError<Self::Error>: From<<Self::Stash as Stash>::Error> { ... } fn transition_builder( &mut self, contract_id: ContractId, iface: impl Into<TypeName>, transition_name: Option<impl Into<TypeName>>, ) -> Result<TransitionBuilder, InventoryError<Self::Error>> where Self::Error: From<<Self::Stash as Stash>::Error> { ... } fn blank_builder( &mut self, contract_id: ContractId, iface: impl Into<TypeName>, ) -> Result<TransitionBuilder, InventoryError<Self::Error>> where Self::Error: From<<Self::Stash as Stash>::Error> { ... } fn export_contract( &mut self, contract_id: ContractId, ) -> Result<Bindle<Contract>, ConsignerError<Self::Error, <<Self as Deref>::Target as Stash>::Error>> { ... } fn transfer( &mut self, contract_id: ContractId, seals: impl IntoIterator<Item = impl Into<BuilderSeal<SingleBlindSeal>>>, ) -> Result<Bindle<Transfer>, ConsignerError<Self::Error, <<Self as Deref>::Target as Stash>::Error>> { ... } fn consign<Seal: ExposedSeal, const TYPE: bool>( &mut self, contract_id: ContractId, seals: impl IntoIterator<Item = impl Into<BuilderSeal<Seal>>>, ) -> Result<Consignment<TYPE>, ConsignerError<Self::Error, <<Self as Deref>::Target as Stash>::Error>> { ... }
}

Required Associated Types§

Source

type Stash: Stash

Source

type Error: Error

Error type which must indicate problems on data retrieval.

Required Methods§

Source

fn stash(&self) -> &Self::Stash

Source

fn import_sigs<I>( &mut self, content_id: ContentId, sigs: I, ) -> Result<(), InventoryDataError<Self::Error>>
where I: IntoIterator<Item = Cert>, I::IntoIter: ExactSizeIterator<Item = Cert>,

Source

fn import_schema( &mut self, schema: impl Into<Bindle<SubSchema>>, ) -> Result<Status, InventoryDataError<Self::Error>>

Source

fn import_iface( &mut self, iface: impl Into<Bindle<Iface>>, ) -> Result<Status, InventoryDataError<Self::Error>>

Source

fn import_iface_impl( &mut self, iimpl: impl Into<Bindle<IfaceImpl>>, ) -> Result<Status, InventoryDataError<Self::Error>>

Source

fn import_contract<R: ResolveHeight>( &mut self, contract: Contract, resolver: &mut R, ) -> Result<Status, InventoryError<Self::Error>>
where R::Error: 'static,

Source

fn accept_transfer<R: ResolveHeight>( &mut self, transfer: Transfer, resolver: &mut R, force: bool, ) -> Result<Status, InventoryError<Self::Error>>
where R::Error: 'static,

Source

fn consume_anchor( &mut self, anchor: Anchor<MerkleBlock>, ) -> Result<(), InventoryError<Self::Error>>

§Safety

Assumes that the bundle belongs to a non-mined witness transaction. Must be used only to consume locally-produced bundles before witness transactions are mined.

Source

fn consume_bundle( &mut self, contract_id: ContractId, bundle: TransitionBundle, witness_txid: Txid, ) -> Result<(), InventoryError<Self::Error>>

§Safety

Assumes that the bundle belongs to a non-mined witness transaction. Must be used only to consume locally-produced bundles before witness transactions are mined.

Source

unsafe fn import_contract_force<R: ResolveHeight>( &mut self, contract: Contract, resolver: &mut R, ) -> Result<Status, InventoryError<Self::Error>>
where R::Error: 'static,

§Safety

Calling this method may lead to including into the stash asset information which may be invalid.

Source

fn contract_iface( &mut self, contract_id: ContractId, iface_id: IfaceId, ) -> Result<ContractIface, InventoryError<Self::Error>>

Source

fn anchored_bundle( &self, opid: OpId, ) -> Result<AnchoredBundle, InventoryError<Self::Error>>

Source

fn transition( &self, opid: OpId, ) -> Result<&Transition, InventoryError<Self::Error>>

Source

fn contracts_by_outpoints( &mut self, outpoints: impl IntoIterator<Item = impl Into<Outpoint>>, ) -> Result<BTreeSet<ContractId>, InventoryError<Self::Error>>

Source

fn public_opouts( &mut self, contract_id: ContractId, ) -> Result<BTreeSet<Opout>, InventoryError<Self::Error>>

Source

fn opouts_by_outpoints( &mut self, contract_id: ContractId, outpoints: impl IntoIterator<Item = impl Into<Outpoint>>, ) -> Result<BTreeSet<Opout>, InventoryError<Self::Error>>

Source

fn opouts_by_terminals( &mut self, terminals: impl IntoIterator<Item = SecretSeal>, ) -> Result<BTreeSet<Opout>, InventoryError<Self::Error>>

Source

fn state_for_outpoints( &mut self, contract_id: ContractId, outpoints: impl IntoIterator<Item = impl Into<Outpoint>>, ) -> Result<BTreeMap<Opout, TypedState>, InventoryError<Self::Error>>

Source

fn store_seal_secret( &mut self, seal: GraphSeal, ) -> Result<(), InventoryError<Self::Error>>

Source

fn seal_secrets( &mut self, ) -> Result<BTreeSet<GraphSeal>, InventoryError<Self::Error>>

Provided Methods§

Source

fn contracts_with_iface( &mut self, iface: impl Into<TypeName>, ) -> Result<Vec<ContractIface>, InventoryError<Self::Error>>
where Self::Error: From<<Self::Stash as Stash>::Error>, InventoryError<Self::Error>: From<<Self::Stash as Stash>::Error>,

Source

fn contract_iface_named( &mut self, contract_id: ContractId, iface: impl Into<TypeName>, ) -> Result<ContractIface, InventoryError<Self::Error>>
where Self::Error: From<<Self::Stash as Stash>::Error>, InventoryError<Self::Error>: From<<Self::Stash as Stash>::Error>,

Source

fn transition_builder( &mut self, contract_id: ContractId, iface: impl Into<TypeName>, transition_name: Option<impl Into<TypeName>>, ) -> Result<TransitionBuilder, InventoryError<Self::Error>>
where Self::Error: From<<Self::Stash as Stash>::Error>,

Source

fn blank_builder( &mut self, contract_id: ContractId, iface: impl Into<TypeName>, ) -> Result<TransitionBuilder, InventoryError<Self::Error>>
where Self::Error: From<<Self::Stash as Stash>::Error>,

Source

fn export_contract( &mut self, contract_id: ContractId, ) -> Result<Bindle<Contract>, ConsignerError<Self::Error, <<Self as Deref>::Target as Stash>::Error>>

Source

fn transfer( &mut self, contract_id: ContractId, seals: impl IntoIterator<Item = impl Into<BuilderSeal<SingleBlindSeal>>>, ) -> Result<Bindle<Transfer>, ConsignerError<Self::Error, <<Self as Deref>::Target as Stash>::Error>>

Source

fn consign<Seal: ExposedSeal, const TYPE: bool>( &mut self, contract_id: ContractId, seals: impl IntoIterator<Item = impl Into<BuilderSeal<Seal>>>, ) -> Result<Consignment<TYPE>, ConsignerError<Self::Error, <<Self as Deref>::Target as Stash>::Error>>

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§