pub struct TopBlocks {
pub mc_block: BlockIdShort,
pub shard_heights: ShardHeights,
}Expand description
Stores last blocks for each workchain and shard.
Fields§
§mc_block: BlockIdShort§shard_heights: ShardHeightsImplementations§
Source§impl TopBlocks
impl TopBlocks
Sourcepub fn from_mc_block(mc_block_data: &BlockStuff) -> Result<Self>
pub fn from_mc_block(mc_block_data: &BlockStuff) -> Result<Self>
Extracts last blocks for each workchain and shard from the given masterchain block.
pub fn shard_heights(&self) -> &ShardHeights
Sourcepub fn contains(&self, block_id: &BlockId) -> bool
pub fn contains(&self, block_id: &BlockId) -> bool
Checks whether the given block is equal to or greater than the last block for the given shard.
Sourcepub fn contains_shard_seqno(&self, shard_ident: &ShardIdent, seqno: u32) -> bool
pub fn contains_shard_seqno(&self, shard_ident: &ShardIdent, seqno: u32) -> bool
Checks whether the given pair of ShardIdent and seqno
is equal to or greater than the last block for the given shard.
NOTE: Specified shard could be split or merged
Sourcepub fn short_ids(&self) -> TopBlocksShortIdsIter<'_> ⓘ
pub fn short_ids(&self) -> TopBlocksShortIdsIter<'_> ⓘ
Returns an iterator over the short ids of the latest blocks.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for TopBlocks
impl RefUnwindSafe for TopBlocks
impl Send for TopBlocks
impl Sync for TopBlocks
impl Unpin for TopBlocks
impl UnwindSafe for TopBlocks
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