Struct lightning_block_sync::poll::ChainPoller [−][src]
The canonical Poll
implementation used for a single BlockSource
.
Other Poll
implementations must be built using ChainPoller
as it provides the only means of
validating chain data.
Implementations
impl<B: DerefMut<Target = T> + Sized + Sync + Send, T: BlockSource> ChainPoller<B, T>
[src]
pub fn new(block_source: B, network: Network) -> Self
[src]
Creates a new poller for the given block source.
If the network
parameter is mainnet, then the difficulty between blocks is checked for
validity.
Trait Implementations
impl<B: DerefMut<Target = T> + Sized + Sync + Send, T: BlockSource> Poll for ChainPoller<B, T>
[src]
fn poll_chain_tip<'a>(
&'a mut self,
best_known_chain_tip: ValidatedBlockHeader
) -> Pin<Box<dyn Future<Output = Result<ChainTip, BlockSourceError>> + Send + 'a>>
[src]
&'a mut self,
best_known_chain_tip: ValidatedBlockHeader
) -> Pin<Box<dyn Future<Output = Result<ChainTip, BlockSourceError>> + Send + 'a>>
fn look_up_previous_header<'a>(
&'a mut self,
header: &'a ValidatedBlockHeader
) -> Pin<Box<dyn Future<Output = Result<ValidatedBlockHeader, BlockSourceError>> + Send + 'a>>
[src]
&'a mut self,
header: &'a ValidatedBlockHeader
) -> Pin<Box<dyn Future<Output = Result<ValidatedBlockHeader, BlockSourceError>> + Send + 'a>>
fn fetch_block<'a>(
&'a mut self,
header: &'a ValidatedBlockHeader
) -> Pin<Box<dyn Future<Output = Result<ValidatedBlock, BlockSourceError>> + Send + 'a>>
[src]
&'a mut self,
header: &'a ValidatedBlockHeader
) -> Pin<Box<dyn Future<Output = Result<ValidatedBlock, BlockSourceError>> + Send + 'a>>
Auto Trait Implementations
impl<B, T> RefUnwindSafe for ChainPoller<B, T> where
B: RefUnwindSafe,
B: RefUnwindSafe,
impl<B, T> Send for ChainPoller<B, T>
impl<B, T> Sync for ChainPoller<B, T>
impl<B, T> Unpin for ChainPoller<B, T> where
B: Unpin,
B: Unpin,
impl<B, T> UnwindSafe for ChainPoller<B, T> where
B: UnwindSafe,
B: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,