Skip to main content

Source

Trait Source 

Source
pub trait Source {
    // Required methods
    fn chain_identifier<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<ChainIdentifier, SourceError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn transaction<'life0, 'async_trait>(
        &'life0 self,
        transaction_digest: TransactionDigest,
    ) -> Pin<Box<dyn Future<Output = Result<Option<SourceTransaction>, SourceError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn object<'life0, 'async_trait>(
        &'life0 self,
        object_id: ObjectId,
        version: Option<Version>,
    ) -> Pin<Box<dyn Future<Output = Result<Option<Object>, SourceError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn checkpoint<'life0, 'async_trait>(
        &'life0 self,
        sequence_number: u64,
    ) -> Pin<Box<dyn Future<Output = Result<Option<SourceCheckpoint>, SourceError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn committee<'life0, 'async_trait>(
        &'life0 self,
        epoch: EpochId,
    ) -> Pin<Box<dyn Future<Output = Result<Committee, SourceError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn current_epoch<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<Option<EpochId>, SourceError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn epoch_close_summary<'life0, 'async_trait>(
        &'life0 self,
        epoch: EpochId,
    ) -> Pin<Box<dyn Future<Output = Result<Option<CertifiedCheckpointSummary>, SourceError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

Ledger-read boundary used by crate::ProofBuilder and crate::CommitteeResolver.

Implementations may fetch evidence from native gRPC, a JavaScript client, archive storage, fixtures, or another source. Proof assembly, target validation, committee authentication, and caching remain outside the source.

Required Methods§

Source

fn chain_identifier<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<ChainIdentifier, SourceError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Fetches the genesis-checkpoint digest that identifies the source chain.

Source

fn transaction<'life0, 'async_trait>( &'life0 self, transaction_digest: TransactionDigest, ) -> Pin<Box<dyn Future<Output = Result<Option<SourceTransaction>, SourceError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Fetches and decodes one executed transaction.

Source

fn object<'life0, 'async_trait>( &'life0 self, object_id: ObjectId, version: Option<Version>, ) -> Pin<Box<dyn Future<Output = Result<Option<Object>, SourceError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Fetches and decodes an object, optionally at an exact version.

Source

fn checkpoint<'life0, 'async_trait>( &'life0 self, sequence_number: u64, ) -> Pin<Box<dyn Future<Output = Result<Option<SourceCheckpoint>, SourceError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Fetches and decodes one certified checkpoint and its contents.

Returns None when the checkpoint does not exist.

Source

fn committee<'life0, 'async_trait>( &'life0 self, epoch: EpochId, ) -> Pin<Box<dyn Future<Output = Result<Committee, SourceError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Fetches the committee reported for epoch.

Source

fn current_epoch<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Option<EpochId>, SourceError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Fetches the current epoch reported by the source.

Source

fn epoch_close_summary<'life0, 'async_trait>( &'life0 self, epoch: EpochId, ) -> Pin<Box<dyn Future<Output = Result<Option<CertifiedCheckpointSummary>, SourceError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Fetches the certified checkpoint summary that closed epoch.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl Source for Client

Source§

fn chain_identifier<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<ChainIdentifier, SourceError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn transaction<'life0, 'async_trait>( &'life0 self, transaction_digest: TransactionDigest, ) -> Pin<Box<dyn Future<Output = Result<Option<SourceTransaction>, SourceError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn object<'life0, 'async_trait>( &'life0 self, object_id: ObjectId, version: Option<Version>, ) -> Pin<Box<dyn Future<Output = Result<Option<Object>, SourceError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn checkpoint<'life0, 'async_trait>( &'life0 self, sequence_number: u64, ) -> Pin<Box<dyn Future<Output = Result<Option<SourceCheckpoint>, SourceError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn committee<'life0, 'async_trait>( &'life0 self, epoch: EpochId, ) -> Pin<Box<dyn Future<Output = Result<Committee, SourceError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn current_epoch<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Option<EpochId>, SourceError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn epoch_close_summary<'life0, 'async_trait>( &'life0 self, epoch: EpochId, ) -> Pin<Box<dyn Future<Output = Result<Option<CertifiedCheckpointSummary>, SourceError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Implementors§