Struct chain_storage::permanent_store::PermanentStore
source · pub(crate) struct PermanentStore {
blocks: Database,
chain_length_index: Database,
block_id_index: Tree,
root_id: Value,
}
Fields§
§blocks: Database
§chain_length_index: Database
§block_id_index: Tree
§root_id: Value
Implementations§
source§impl PermanentStore
impl PermanentStore
pub fn file<P: AsRef<Path>, I: Into<Value>>( path: P, block_id_index: Tree, root_id: I ) -> Result<PermanentStore, Error>
pub fn memory<I: Into<Value>>( block_id_index: Tree, root_id: I ) -> Result<PermanentStore, Error>
pub fn get_block_by_chain_length(&self, chain_length: u32) -> Option<Value>
pub fn get_block(&self, block_id: &[u8]) -> Result<Option<Value>, Error>
pub fn get_block_info( &self, block_id: &[u8] ) -> Result<Option<BlockInfo>, Error>
pub fn get_block_info_by_chain_length( &self, chain_length: u32 ) -> Result<Option<BlockInfo>, Error>
fn get_chain_length(&self, block_id: &[u8]) -> Result<Option<u32>, Error>
pub fn contains_key(&self, block_id: &[u8]) -> Result<bool, Error>
pub fn put_blocks( &self, start_chain_length: u32, ids: &[&[u8]], blocks: &[&[u8]] ) -> Result<(), Error>
pub fn iter(&self, chain_length: u32) -> Result<SeqNoIter, Error>
pub fn block_id_index(&self) -> &Tree
Trait Implementations§
source§impl Clone for PermanentStore
impl Clone for PermanentStore
source§fn clone(&self) -> PermanentStore
fn clone(&self) -> PermanentStore
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 moreAuto Trait Implementations§
impl !RefUnwindSafe for PermanentStore
impl Send for PermanentStore
impl Sync for PermanentStore
impl Unpin for PermanentStore
impl !UnwindSafe for PermanentStore
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