pub struct BlockRangeScannerBuilder {
pub max_block_range: u64,
pub past_blocks_storage_capacity: RingBufferCapacity,
pub buffer_capacity: usize,
}Expand description
Builder/configuration for the block-range streaming service.
Fields§
§max_block_range: u64Maximum number of blocks per streamed range.
past_blocks_storage_capacity: RingBufferCapacityHow many past block hashes to keep in memory for reorg detection.
If set to RingBufferCapacity::Limited(0), reorg detection is disabled.
buffer_capacity: usizeImplementations§
Source§impl BlockRangeScannerBuilder
impl BlockRangeScannerBuilder
Sourcepub fn max_block_range(self, max_block_range: u64) -> Self
pub fn max_block_range(self, max_block_range: u64) -> Self
Sets the maximum number of blocks per streamed range.
This controls batching for historical scans and for catch-up in live/sync scanners.
Must be greater than 0.
Sourcepub fn past_blocks_storage_capacity(
self,
past_blocks_storage_capacity: RingBufferCapacity,
) -> Self
pub fn past_blocks_storage_capacity( self, past_blocks_storage_capacity: RingBufferCapacity, ) -> Self
Sets how many past block hashes to keep in memory for reorg detection.
If set to RingBufferCapacity::Limited(0), reorg detection is disabled.
Sourcepub fn buffer_capacity(self, buffer_capacity: usize) -> Self
pub fn buffer_capacity(self, buffer_capacity: usize) -> Self
Sets the stream buffer capacity.
Controls the maximum number of messages that can be buffered in the stream before backpressure is applied.
§Arguments
buffer_capacity- Maximum number of messages to buffer (must be greater than 0)
Sourcepub async fn connect<N: Network>(
self,
provider: impl IntoRobustProvider<N>,
) -> Result<BlockRangeScanner<N>, ScannerError>
pub async fn connect<N: Network>( self, provider: impl IntoRobustProvider<N>, ) -> Result<BlockRangeScanner<N>, ScannerError>
Trait Implementations§
Source§impl Clone for BlockRangeScannerBuilder
impl Clone for BlockRangeScannerBuilder
Source§fn clone(&self) -> BlockRangeScannerBuilder
fn clone(&self) -> BlockRangeScannerBuilder
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for BlockRangeScannerBuilder
impl Debug for BlockRangeScannerBuilder
Auto Trait Implementations§
impl Freeze for BlockRangeScannerBuilder
impl RefUnwindSafe for BlockRangeScannerBuilder
impl Send for BlockRangeScannerBuilder
impl Sync for BlockRangeScannerBuilder
impl Unpin for BlockRangeScannerBuilder
impl UnsafeUnpin for BlockRangeScannerBuilder
impl UnwindSafe for BlockRangeScannerBuilder
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
Mutably borrows from an owned value. Read more
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>
Converts
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>
Converts
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 more