Skip to content

Commit 319b813

Browse files
committed
ref: rename generic param 'M' to 'Mode'
1 parent e56c03c commit 319b813

File tree

1 file changed

+8
-8
lines changed
  • src/event_scanner/scanner

1 file changed

+8
-8
lines changed

src/event_scanner/scanner/mod.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ impl Default for Live {
138138
}
139139
}
140140

141-
/// An event scanner configured in mode `M` and bound to network `N`.
141+
/// An event scanner configured in mode `Mode` and bound to network `N`.
142142
///
143143
/// Create an instance via [`EventScannerBuilder`], register subscriptions with
144144
/// [`EventScanner::subscribe`], then start the scanner with the mode-specific `start()` method.
@@ -154,16 +154,16 @@ impl Default for Live {
154154
/// Subscription streams yield events asynchronously.
155155
/// - **Errors after startup**: most runtime failures are delivered through subscription streams as
156156
/// [`ScannerError`] items, rather than being returned from `start()`.
157-
pub struct EventScanner<M = Unspecified, N: Network = Ethereum> {
158-
config: M,
157+
pub struct EventScanner<Mode = Unspecified, N: Network = Ethereum> {
158+
config: Mode,
159159
block_range_scanner: ConnectedBlockRangeScanner<N>,
160160
listeners: Vec<EventListener>,
161161
}
162162

163163
/// Builder for constructing an [`EventScanner`] in a particular mode.
164164
#[derive(Default)]
165-
pub struct EventScannerBuilder<M> {
166-
pub(crate) config: M,
165+
pub struct EventScannerBuilder<Mode> {
166+
pub(crate) config: Mode,
167167
pub(crate) block_range_scanner: BlockRangeScanner,
168168
}
169169

@@ -490,7 +490,7 @@ impl EventScannerBuilder<SyncFromBlock> {
490490
}
491491
}
492492

493-
impl<M> EventScannerBuilder<M> {
493+
impl<Mode> EventScannerBuilder<Mode> {
494494
/// Sets the maximum block range per event batch.
495495
///
496496
/// Controls how the scanner splits a large block range into smaller batches for processing.
@@ -536,7 +536,7 @@ impl<M> EventScannerBuilder<M> {
536536
async fn build<N: Network>(
537537
self,
538538
provider: impl IntoRobustProvider<N>,
539-
) -> Result<EventScanner<M, N>, ScannerError> {
539+
) -> Result<EventScanner<Mode, N>, ScannerError> {
540540
if self.block_range_scanner.max_block_range == 0 {
541541
return Err(ScannerError::InvalidMaxBlockRange);
542542
}
@@ -545,7 +545,7 @@ impl<M> EventScannerBuilder<M> {
545545
}
546546
}
547547

548-
impl<M, N: Network> EventScanner<M, N> {
548+
impl<Mode, N: Network> EventScanner<Mode, N> {
549549
/// Registers an event subscription and returns its stream.
550550
///
551551
/// Each call creates a separate subscription stream with its own buffer.

0 commit comments

Comments
 (0)