pub trait ConsignmentApi {
// Required methods
fn schema(&self) -> &Schema;
fn types(&self) -> &TypeSystem;
fn scripts(&self) -> &Scripts;
fn operation(&self, opid: OpId) -> Option<OpRef<'_>>;
fn genesis(&self) -> &Genesis;
fn bundles<'iter>(&self) -> impl Iterator<Item = TransitionBundle> + 'iter;
fn bundle_ids<'iter>(&self) -> impl Iterator<Item = BundleId> + 'iter;
fn bundle(&self, bundle_id: BundleId) -> Option<&TransitionBundle>;
fn anchor(&self, bundle_id: BundleId) -> Option<(Txid, &EAnchor)>;
fn op_witness_id(&self, opid: OpId) -> Option<Txid>;
}
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§
Sourcefn types(&self) -> &TypeSystem
fn types(&self) -> &TypeSystem
Returns reference to the type system.
Sourcefn scripts(&self) -> &Scripts
fn scripts(&self) -> &Scripts
Returns reference to a collection of AluVM libraries used for the validation.
Sourcefn operation(&self, opid: OpId) -> Option<OpRef<'_>>
fn operation(&self, opid: OpId) -> Option<OpRef<'_>>
Retrieves reference to an operation (genesis or state transition) matching the provided id,
or None
otherwise
Sourcefn bundles<'iter>(&self) -> impl Iterator<Item = TransitionBundle> + 'iter
fn bundles<'iter>(&self) -> impl Iterator<Item = TransitionBundle> + 'iter
Returns iterator over all bundles present in the consignment.
Sourcefn bundle_ids<'iter>(&self) -> impl Iterator<Item = BundleId> + 'iter
fn bundle_ids<'iter>(&self) -> impl Iterator<Item = BundleId> + 'iter
Returns iterator over all bundle ids present in the consignment.
Sourcefn bundle(&self, bundle_id: BundleId) -> Option<&TransitionBundle>
fn bundle(&self, bundle_id: BundleId) -> Option<&TransitionBundle>
Returns reference to a bundle given a bundle id.
Sourcefn anchor(&self, bundle_id: BundleId) -> Option<(Txid, &EAnchor)>
fn anchor(&self, bundle_id: BundleId) -> Option<(Txid, &EAnchor)>
Returns a grip given a bundle id.
Sourcefn op_witness_id(&self, opid: OpId) -> Option<Txid>
fn op_witness_id(&self, opid: OpId) -> Option<Txid>
Returns witness id for a given operation.
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.