pub trait BalSource: Send + Sync {
// Required methods
fn head<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<u64>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn finalized<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<u64>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn block<'life0, 'async_trait>(
&'life0 self,
number: u64,
) -> Pin<Box<dyn Future<Output = Result<SourcedBlock>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
// Provided methods
fn header<'life0, 'async_trait>(
&'life0 self,
number: u64,
) -> Pin<Box<dyn Future<Output = Result<Header>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait { ... }
fn bal<'life0, 'async_trait>(
&'life0 self,
number: u64,
) -> Pin<Box<dyn Future<Output = Result<BlockAccessList>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait { ... }
}Expand description
Where blocks and their BALs come from.
Required Methods§
Sourcefn head<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<u64>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn head<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<u64>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Latest block number the source knows.
Provided Methods§
Sourcefn header<'life0, 'async_trait>(
&'life0 self,
number: u64,
) -> Pin<Box<dyn Future<Output = Result<Header>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn header<'life0, 'async_trait>(
&'life0 self,
number: u64,
) -> Pin<Box<dyn Future<Output = Result<Header>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Header only. Used for reorg checks, where fetching the BAL would be
wasted work; the default goes through BalSource::block.
Sourcefn bal<'life0, 'async_trait>(
&'life0 self,
number: u64,
) -> Pin<Box<dyn Future<Output = Result<BlockAccessList>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn bal<'life0, 'async_trait>(
&'life0 self,
number: u64,
) -> Pin<Box<dyn Future<Output = Result<BlockAccessList>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
BAL body only, unverified. Lets a backup supply the body while the header — the canonical-chain fact — still comes from the primary.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementations on Foreign Types§
Source§impl<S: BalSource + ?Sized> BalSource for &S
impl<S: BalSource + ?Sized> BalSource for &S
fn head<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<u64>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn finalized<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<u64>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn block<'life0, 'async_trait>(
&'life0 self,
number: u64,
) -> Pin<Box<dyn Future<Output = Result<SourcedBlock>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn header<'life0, 'async_trait>(
&'life0 self,
number: u64,
) -> Pin<Box<dyn Future<Output = Result<Header>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn bal<'life0, 'async_trait>(
&'life0 self,
number: u64,
) -> Pin<Box<dyn Future<Output = Result<BlockAccessList>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§impl<S: BalSource> BalSource for Option<S>
Option<S> is a source that is simply absent: every call fails with
crate::SourceError::Transport. Lets Fallback<P, Option<B>> express
“backup configured or not” without a second type.
impl<S: BalSource> BalSource for Option<S>
Option<S> is a source that is simply absent: every call fails with
crate::SourceError::Transport. Lets Fallback<P, Option<B>> express
“backup configured or not” without a second type.