pub struct BlockRing {
pub ring: Vec<RingItem>,
pub lc_pos: Option<usize>,
pub empty: bool,
pub genesis_period: BlockId,
}
Fields§
§ring: Vec<RingItem>
§lc_pos: Option<usize>
§empty: bool
§genesis_period: BlockId
Implementations§
Source§impl BlockRing
impl BlockRing
pub fn get_ring_buffer_size(&self) -> BlockId
pub fn add_block(&mut self, block: &Block)
pub fn contains_block_hash_at_block_id( &self, block_id: u64, block_hash: SaitoHash, ) -> bool
pub fn get_latest_block_hash(&self) -> SaitoHash
pub fn get_latest_block_id(&self) -> BlockId
pub fn get_longest_chain_block_hash_at_block_id( &self, id: u64, ) -> Option<SaitoHash>
pub fn is_block_hash_at_block_id( &self, block_id: u64, block_hash: SaitoHash, ) -> bool
pub fn is_empty(&self) -> bool
pub fn delete_block(&mut self, block_id: u64, block_hash: SaitoHash)
pub fn get_block_hashes_at_block_id(&self, block_id: u64) -> Vec<SaitoHash> ⓘ
pub fn on_chain_reorganization( &mut self, block_id: u64, hash: SaitoHash, lc: bool, ) -> bool
pub fn print_lc(&self)
pub fn get_block_hash_by_block_id(&self, block_id: u64) -> Option<SaitoHash>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for BlockRing
impl RefUnwindSafe for BlockRing
impl Send for BlockRing
impl Sync for BlockRing
impl Unpin for BlockRing
impl UnwindSafe for BlockRing
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