ConsignmentApi

Trait ConsignmentApi 

Source
pub trait ConsignmentApi {
    // Required methods
    fn schema(&self) -> &Schema;
    fn types(&self) -> &TypeSystem;
    fn scripts(&self) -> impl Iterator<Item = &Lib>;
    fn genesis(&self) -> &Genesis;
    fn bundles_info(
        &self,
    ) -> impl Iterator<Item = (&TransitionBundle, &Anchor<DbcProof>, Txid)>;

    // Provided method
    fn bundle_ids<'iter>(&self) -> impl Iterator<Item = BundleId> + 'iter { ... }
}
Expand description

Trait defining common data access API for all storage-related RGB structures

The API provided for the consignment should not verify the internal consistency, schema conformance or validation status of the RGB contract data within the storage or container. If the methods are called on an invalid or absent data, the API must always return None or empty collections/iterators.

Required Methods§

Source

fn schema(&self) -> &Schema

Returns reference to the schema object used by the consignment.

Source

fn types(&self) -> &TypeSystem

Returns reference to the type system.

Source

fn scripts(&self) -> impl Iterator<Item = &Lib>

Returns reference to a collection of AluVM libraries used for the validation.

Source

fn genesis(&self) -> &Genesis

Contract genesis.

Source

fn bundles_info( &self, ) -> impl Iterator<Item = (&TransitionBundle, &Anchor<DbcProof>, Txid)>

Returns iterator over all bundle information in the consignment

Provided Methods§

Source

fn bundle_ids<'iter>(&self) -> impl Iterator<Item = BundleId> + 'iter

Returns iterator over all bundle ids present in the consignment.

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§

Source§

impl<C> ConsignmentApi for CheckedConsignment<'_, C>
where C: ConsignmentApi,

Source§

impl<const TRANSFER: bool> ConsignmentApi for Consignment<TRANSFER>