Struct jormungandr::blockchain::Checkpoints
source · pub struct Checkpoints(Vec<HeaderHash>);
Expand description
list of pre-computed checkpoints from a given Ref
.
Tuple Fields§
§0: Vec<HeaderHash>
Implementations§
source§impl Checkpoints
impl Checkpoints
sourcepub fn new_from(from: Arc<Ref>) -> Self
pub fn new_from(from: Arc<Ref>) -> Self
create a new list of checkpoints from the given starting point (tip).
The function make use of the Ref
object pointing to previous epoch in order
to populate interestingly spaced checkpoints.
For now the algorithm provide the current block, the parent, the last block of the previous epoch, the last block of the epoch before that… until the block0.
pub fn iter(&self) -> impl Iterator<Item = &HeaderHash>
pub fn as_slice(&self) -> &[HeaderHash]
Trait Implementations§
source§impl AsRef<[Hash]> for Checkpoints
impl AsRef<[Hash]> for Checkpoints
source§fn as_ref(&self) -> &[HeaderHash]
fn as_ref(&self) -> &[HeaderHash]
Converts this type into a shared reference of the (usually inferred) input type.
source§impl Clone for Checkpoints
impl Clone for Checkpoints
source§fn clone(&self) -> Checkpoints
fn clone(&self) -> Checkpoints
Returns a copy 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 Checkpoints
impl Debug for Checkpoints
source§impl From<Checkpoints> for Vec<HeaderHash>
impl From<Checkpoints> for Vec<HeaderHash>
source§fn from(checkpoints: Checkpoints) -> Self
fn from(checkpoints: Checkpoints) -> Self
Converts to this type from the input type.
source§impl IntoIterator for Checkpoints
impl IntoIterator for Checkpoints
source§impl PartialEq<Checkpoints> for Checkpoints
impl PartialEq<Checkpoints> for Checkpoints
source§fn eq(&self, other: &Checkpoints) -> bool
fn eq(&self, other: &Checkpoints) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl Eq for Checkpoints
impl StructuralEq for Checkpoints
impl StructuralPartialEq for Checkpoints
Auto Trait Implementations§
impl RefUnwindSafe for Checkpoints
impl Send for Checkpoints
impl Sync for Checkpoints
impl Unpin for Checkpoints
impl UnwindSafe for Checkpoints
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<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T
in a tonic::Request
source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T
in a tonic::Request