pub struct WatchBlocksFrom<N: Network> { /* private fields */ }Expand description
A builder for streaming blocks from a historical block and continuing indefinitely.
Implementations§
Source§impl<N: Network> WatchBlocksFrom<N>
impl<N: Network> WatchBlocksFrom<N>
Sourcepub const fn poll_interval(self, poll_interval: Duration) -> Self
pub const fn poll_interval(self, poll_interval: Duration) -> Self
Sets the poll interval used when the stream is caught up.
Sourcepub const fn block_tag(self, block_tag: BlockNumberOrTag) -> Self
pub const fn block_tag(self, block_tag: BlockNumberOrTag) -> Self
Sets the head block tag used to determine stream progress.
Sourcepub const fn canonical(self) -> WatchCanonicalBlocksFrom<N>
pub const fn canonical(self) -> WatchCanonicalBlocksFrom<N>
Converts this builder into a canonical-stream builder that emits
crate::CanonicalEvent deltas on reorgs.
Sourcepub const fn into_stream(self) -> WatchBlocksFromStream<N>
pub const fn into_stream(self) -> WatchBlocksFromStream<N>
Stream blocks from a historical block using sequential eth_getBlockByNumber calls.
This stream continues polling after catching up and continues yielding new blocks indefinitely.
This stream does not handle reorgs. Instead, each item yielded from the stream is strictly ordered in terms of block number, regardless of the blocks parent.
For example (height, hash, parent):
You should expect blocks in order by number with no gaps and with disjoint parents: [(1, 1A, 0A),(2, 2A, 1A),(3,3B,2B)]
And you should not expect receiving two blocks with the same number: [(1, 1A, 0A),(2, 2A, 1A),(2,2B,1A)]
Each yielded future contains one block request.
If a block request returns NullResp, the yielded future retries the same block until it
succeeds.
Other errors are surfaced to the caller. Configure retries on the underlying client
transport (for example with RetryBackoffLayer) for transport-level retry behavior.
This can be buffered by the caller, for example with
StreamExt::buffered.
Trait Implementations§
Auto Trait Implementations§
impl<N> !RefUnwindSafe for WatchBlocksFrom<N>
impl<N> !UnwindSafe for WatchBlocksFrom<N>
impl<N> Freeze for WatchBlocksFrom<N>
impl<N> Send for WatchBlocksFrom<N>
impl<N> Sync for WatchBlocksFrom<N>
impl<N> Unpin for WatchBlocksFrom<N>
impl<N> UnsafeUnpin for WatchBlocksFrom<N>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> WithSubscriber for T
impl<T> WithSubscriber for T
Source§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
Source§fn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...) attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 56 bytes