pub struct HeaderSnapshot { /* private fields */ }Expand description
One pass’s view of the active chain: the tip and the headers at the heights the pass named, read from the header service through the wallet’s services. Fails closed: a height that was not read has no answer, a read that failed is a fault, and with no tip nothing checks.
Implementations§
Source§impl HeaderSnapshot
impl HeaderSnapshot
Sourcepub async fn take<V: WalletServices + ?Sized>(
services: &V,
heights: impl IntoIterator<Item = Height>,
) -> Self
pub async fn take<V: WalletServices + ?Sized>( services: &V, heights: impl IntoIterator<Item = Height>, ) -> Self
Read the tip and the headers at heights.
Sourcepub async fn extend<V: WalletServices + ?Sized>(
&mut self,
services: &V,
heights: impl IntoIterator<Item = Height>,
)
pub async fn extend<V: WalletServices + ?Sized>( &mut self, services: &V, heights: impl IntoIterator<Item = Height>, )
Read the headers at heights that this snapshot does not hold yet.
Trait Implementations§
Source§impl Clone for HeaderSnapshot
impl Clone for HeaderSnapshot
Source§impl Debug for HeaderSnapshot
impl Debug for HeaderSnapshot
Source§impl Headers for HeaderSnapshot
impl Headers for HeaderSnapshot
Source§fn header_at(&self, height: Height) -> Result<Option<Header>, HeaderError>
fn header_at(&self, height: Height) -> Result<Option<Header>, HeaderError>
Look up an active header, or no answer while behind or unverified.
Source§fn tip_height(&self) -> Result<Height, HeaderError>
fn tip_height(&self) -> Result<Height, HeaderError>
The active height from the same snapshot.
Source§fn check(&self, proof: Proof) -> Result<CheckedProof, CheckError>
fn check(&self, proof: Proof) -> Result<CheckedProof, CheckError>
Reduce a bound SDK proof and check it against the active header.
Tracker transitions always invoke this default implementation through
a snapshot wrapper, so host overrides cannot bypass current lookups.
Auto Trait Implementations§
impl Freeze for HeaderSnapshot
impl RefUnwindSafe for HeaderSnapshot
impl Send for HeaderSnapshot
impl Sync for HeaderSnapshot
impl Unpin for HeaderSnapshot
impl UnsafeUnpin for HeaderSnapshot
impl UnwindSafe for HeaderSnapshot
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