pub struct Blocks(/* private fields */);Expand description
Block iterator factory
Creates iterators over Bitcoin blocks from various sources (RPC/Reader). Iterators may end earlier than expected if a chain reorganization occurs.
Thread-safe and free to clone.
Implementations§
Source§impl Blocks
impl Blocks
Sourcepub fn new(client: &Client, reader: &Reader) -> Self
pub fn new(client: &Client, reader: &Reader) -> Self
Create with smart mode (auto-select source based on range size)
Sourcepub fn new_reader(reader: &Reader) -> Self
pub fn new_reader(reader: &Reader) -> Self
Create with Reader-only mode
Sourcepub fn range(&self, start: Height, end: Height) -> Result<BlockIterator>
pub fn range(&self, start: Height, end: Height) -> Result<BlockIterator>
Iterate over a specific range (start..=end)
Sourcepub fn start(&self, start: Height) -> Result<BlockIterator>
pub fn start(&self, start: Height) -> Result<BlockIterator>
Iterate from start (inclusive) to chain tip
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Blocks
impl !UnwindSafe for Blocks
impl Freeze for Blocks
impl Send for Blocks
impl Sync for Blocks
impl Unpin for Blocks
impl UnsafeUnpin for Blocks
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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