pub struct ChunkedEvent<P, E, N = Ethereum> { /* private fields */ }Expand description
A chunked event query builder.
Created via Event::chunked. Configure chunk size and concurrency, then call
query or query_raw.
Attempts the full block range optimistically first. If that fails, the range is split into
chunk_size-block windows queried concurrently (bounded by max_concurrent). If an
individual chunk still fails, each block in that chunk is queried individually.
Implementations§
Source§impl<P, E, N> ChunkedEvent<P, E, N>
impl<P, E, N> ChunkedEvent<P, E, N>
Sourcepub fn chunk_size(self, chunk_size: u64) -> Self
pub fn chunk_size(self, chunk_size: u64) -> Self
Sourcepub fn concurrent(self, max_concurrent: usize) -> Self
pub fn concurrent(self, max_concurrent: usize) -> Self
Sets the maximum number of concurrent chunk requests (default: 5).
§Panics
Panics if max_concurrent is 0.
Source§impl<P: Provider<N> + Clone, E: SolEvent, N: Network> ChunkedEvent<P, E, N>
impl<P: Provider<N> + Clone, E: SolEvent, N: Network> ChunkedEvent<P, E, N>
Sourcepub async fn query(&self) -> Result<Vec<(E, Log)>, Error>
pub async fn query(&self) -> Result<Vec<(E, Log)>, Error>
Queries the blockchain for matching event logs, decoding them.
See query_raw for the full description of the chunked strategy.
Sourcepub async fn query_raw(&self) -> TransportResult<Vec<Log>>
pub async fn query_raw(&self) -> TransportResult<Vec<Log>>
Queries the blockchain for matching event logs, without decoding.
Attempts the full block range optimistically first. If that fails, splits the range into
chunk_size-block windows queried concurrently (up to max_concurrent at a time). If an
individual chunk still fails, falls back to querying each block individually.
Trait Implementations§
Source§impl<P: Clone, E: Clone, N: Clone> Clone for ChunkedEvent<P, E, N>
impl<P: Clone, E: Clone, N: Clone> Clone for ChunkedEvent<P, E, N>
Source§fn clone(&self) -> ChunkedEvent<P, E, N>
fn clone(&self) -> ChunkedEvent<P, E, N>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl<P: Debug, E, N> Debug for ChunkedEvent<P, E, N>
impl<P: Debug, E, N> Debug for ChunkedEvent<P, E, N>
Source§impl<P: Provider<N> + Clone + 'static, E: SolEvent + Send + Sync + 'static, N: Network> IntoFuture for ChunkedEvent<P, E, N>
impl<P: Provider<N> + Clone + 'static, E: SolEvent + Send + Sync + 'static, N: Network> IntoFuture for ChunkedEvent<P, E, N>
Source§type Output = Result<Vec<(E, Log)>, Error>
type Output = Result<Vec<(E, Log)>, Error>
Source§type IntoFuture = Pin<Box<dyn Future<Output = <ChunkedEvent<P, E, N> as IntoFuture>::Output> + Send>>
type IntoFuture = Pin<Box<dyn Future<Output = <ChunkedEvent<P, E, N> as IntoFuture>::Output> + Send>>
Source§fn into_future(self) -> Self::IntoFuture
fn into_future(self) -> Self::IntoFuture
Auto Trait Implementations§
impl<P, E, N = Ethereum> !Freeze for ChunkedEvent<P, E, N>
impl<P, E, N> RefUnwindSafe for ChunkedEvent<P, E, N>
impl<P, E, N> Send for ChunkedEvent<P, E, N>
impl<P, E, N> Sync for ChunkedEvent<P, E, N>
impl<P, E, N> Unpin for ChunkedEvent<P, E, N>
impl<P, E, N> UnsafeUnpin for ChunkedEvent<P, E, N>where
P: UnsafeUnpin,
impl<P, E, N> UnwindSafe for ChunkedEvent<P, E, 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> 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: Unable to compute type layout, possibly due to this type having generic parameters. Layout can only be computed for concrete, fully-instantiated types.