pub struct BlockMetaStore {
pub difficulty_state: DifficultyState,
/* private fields */
}Fields§
§difficulty_state: DifficultyStateImplementations§
Source§impl BlockMetaStore
impl BlockMetaStore
pub fn new(node_path: PathBuf) -> Self
Sourcepub fn save_block_meta(
&self,
block_meta: BlockMetadata,
) -> Result<(), BlockMetaStoreError>
pub fn save_block_meta( &self, block_meta: BlockMetadata, ) -> Result<(), BlockMetaStoreError>
Saves block metadata to disk and updates indices
pub fn get_height(&self) -> usize
pub fn get_last_block_hash(&self) -> Hash
pub fn get_meta_by_height(&self, height: usize) -> Option<BlockMetadata>
pub fn get_meta_by_hash(&self, hash: Hash) -> Option<BlockMetadata>
Trait Implementations§
Source§impl<'__de, __Context> BorrowDecode<'__de, __Context> for BlockMetaStore
impl<'__de, __Context> BorrowDecode<'__de, __Context> for BlockMetaStore
Source§fn borrow_decode<__D: BorrowDecoder<'__de, Context = __Context>>(
decoder: &mut __D,
) -> Result<Self, DecodeError>
fn borrow_decode<__D: BorrowDecoder<'__de, Context = __Context>>( decoder: &mut __D, ) -> Result<Self, DecodeError>
Attempt to decode this type with the given BorrowDecode.
Source§impl Clone for BlockMetaStore
impl Clone for BlockMetaStore
Source§impl<__Context> Decode<__Context> for BlockMetaStore
impl<__Context> Decode<__Context> for BlockMetaStore
Auto Trait Implementations§
impl !Freeze for BlockMetaStore
impl RefUnwindSafe for BlockMetaStore
impl Send for BlockMetaStore
impl Sync for BlockMetaStore
impl Unpin for BlockMetaStore
impl UnwindSafe for BlockMetaStore
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