pub struct HeaderIndexView { /* private fields */ }
Implementations§
Source§impl HeaderIndexView
impl HeaderIndexView
pub fn new( hash: Byte32, number: BlockNumber, epoch: EpochNumberWithFraction, timestamp: u64, parent_hash: Byte32, total_difficulty: U256, ) -> Self
pub fn hash(&self) -> Byte32
pub fn number(&self) -> BlockNumber
pub fn epoch(&self) -> EpochNumberWithFraction
pub fn timestamp(&self) -> u64
pub fn total_difficulty(&self) -> &U256
pub fn parent_hash(&self) -> Byte32
pub fn skip_hash(&self) -> Option<&Byte32>
pub fn build_skip<F, G>(
&mut self,
tip_number: BlockNumber,
get_header_view: F,
fast_scanner: G,
)where
F: Fn(&Byte32, bool) -> Option<HeaderIndexView>,
G: Fn(BlockNumber, BlockNumberAndHash) -> Option<HeaderIndexView>,
pub fn get_ancestor<F, G>(
&self,
tip_number: BlockNumber,
number: BlockNumber,
get_header_view: F,
fast_scanner: G,
) -> Option<HeaderIndexView>where
F: Fn(&Byte32, bool) -> Option<HeaderIndexView>,
G: Fn(BlockNumber, BlockNumberAndHash) -> Option<HeaderIndexView>,
pub fn as_header_index(&self) -> HeaderIndex
pub fn number_and_hash(&self) -> BlockNumberAndHash
pub fn is_better_than(&self, total_difficulty: &U256) -> bool
Trait Implementations§
Source§impl Clone for HeaderIndexView
impl Clone for HeaderIndexView
Source§fn clone(&self) -> HeaderIndexView
fn clone(&self) -> HeaderIndexView
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 HeaderIndexView
impl Debug for HeaderIndexView
Source§impl From<(Byte32, HeaderIndexViewInner)> for HeaderIndexView
impl From<(Byte32, HeaderIndexViewInner)> for HeaderIndexView
Source§impl From<(HeaderView, U256)> for HeaderIndexView
impl From<(HeaderView, U256)> for HeaderIndexView
Source§fn from((header, total_difficulty): (HeaderView, U256)) -> Self
fn from((header, total_difficulty): (HeaderView, U256)) -> Self
Converts to this type from the input type.
Source§impl From<HeaderIndexView> for (Byte32, HeaderIndexViewInner)
impl From<HeaderIndexView> for (Byte32, HeaderIndexViewInner)
Source§fn from(view: HeaderIndexView) -> Self
fn from(view: HeaderIndexView) -> Self
Converts to this type from the input type.
Source§impl PartialEq for HeaderIndexView
impl PartialEq for HeaderIndexView
impl Eq for HeaderIndexView
impl StructuralPartialEq for HeaderIndexView
Auto Trait Implementations§
impl !Freeze for HeaderIndexView
impl RefUnwindSafe for HeaderIndexView
impl Send for HeaderIndexView
impl Sync for HeaderIndexView
impl Unpin for HeaderIndexView
impl UnwindSafe for HeaderIndexView
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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