pub struct ImmortalLog { /* private fields */ }Expand description
The append-only immortal log. Source of truth — everything written here is permanent.
Implementations§
Source§impl ImmortalLog
impl ImmortalLog
Sourcepub fn append(
&mut self,
block_type: BlockType,
content: BlockContent,
) -> Result<Block, Error>
pub fn append( &mut self, block_type: BlockType, content: BlockContent, ) -> Result<Block, Error>
Append a block to the log
Sourcepub fn get_by_hash(&self, hash: &BlockHash) -> Option<Block>
pub fn get_by_hash(&self, hash: &BlockHash) -> Option<Block>
Get block by hash
Sourcepub fn iter_range(
&self,
start: u64,
end: u64,
) -> impl Iterator<Item = Block> + '_
pub fn iter_range( &self, start: u64, end: u64, ) -> impl Iterator<Item = Block> + '_
Iterate over blocks in sequence range
Sourcepub fn verify_integrity(&self) -> IntegrityReport
pub fn verify_integrity(&self) -> IntegrityReport
Verify integrity of entire log
Auto Trait Implementations§
impl Freeze for ImmortalLog
impl RefUnwindSafe for ImmortalLog
impl Send for ImmortalLog
impl Sync for ImmortalLog
impl Unpin for ImmortalLog
impl UnsafeUnpin for ImmortalLog
impl UnwindSafe for ImmortalLog
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