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§
Sourcefn 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 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.
Sourcefn 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 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.
Sourcefn 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 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.
Sourcefn 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 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.
Sourcefn 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 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.
Sourcefn 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 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.
Sourcefn 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,
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".