Struct chainhook_sdk::indexer::ChainSegment
source · pub struct ChainSegment {
pub amount_of_btc_spent: u64,
pub most_recent_confirmed_block_height: u64,
pub block_ids: VecDeque<BlockIdentifier>,
/* private fields */
}Fields§
§amount_of_btc_spent: u64§most_recent_confirmed_block_height: u64§block_ids: VecDeque<BlockIdentifier>Implementations§
source§impl ChainSegment
impl ChainSegment
pub fn new() -> ChainSegment
pub fn append_block_identifier(&mut self, block_identifier: &BlockIdentifier)
pub fn prune_confirmed_blocks( &mut self, cut_off: &BlockIdentifier ) -> Vec<BlockIdentifier>
pub fn get_tip(&self) -> &BlockIdentifier
pub fn get_length(&self) -> u64
pub fn keep_blocks_from_oldest_to_block_identifier( &mut self, block_identifier: &BlockIdentifier ) -> (bool, bool)
Trait Implementations§
source§impl Clone for ChainSegment
impl Clone for ChainSegment
source§fn clone(&self) -> ChainSegment
fn clone(&self) -> ChainSegment
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 ChainSegment
impl Debug for ChainSegment
source§impl Display for ChainSegment
impl Display for ChainSegment
source§impl PartialEq<ChainSegment> for ChainSegment
impl PartialEq<ChainSegment> for ChainSegment
source§fn eq(&self, other: &ChainSegment) -> bool
fn eq(&self, other: &ChainSegment) -> bool
This method tests for
self and other values to be equal, and is used
by ==.impl Eq for ChainSegment
impl StructuralEq for ChainSegment
impl StructuralPartialEq for ChainSegment
Auto Trait Implementations§
impl RefUnwindSafe for ChainSegment
impl Send for ChainSegment
impl Sync for ChainSegment
impl Unpin for ChainSegment
impl UnwindSafe for ChainSegment
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<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.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.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>
§impl<T> IntoCollection<T> for T
impl<T> IntoCollection<T> for T
§fn into_collection<A>(self) -> SmallVec<A>where
A: Array<Item = T>,
fn into_collection<A>(self) -> SmallVec<A>where A: Array<Item = T>,
Converts
self into a collection.