[][src]Struct hycon_rust::database::block_db::BlockDB

pub struct BlockDB<BlockFileType = BlockFile, DatabaseType = RocksDB> where
    BlockFileType: BlockFileOps,
    DatabaseType: IDB
{ /* fields omitted */ }

Methods

impl<BlockFileType, DatabaseType, OptionType> BlockDB<BlockFileType, DatabaseType> where
    BlockFileType: BlockFileOps,
    DatabaseType: IDB<OptionType = OptionType>, 
[src]

pub fn new(
    db_path: PathBuf,
    file_path: PathBuf,
    db_keys: DBKeys,
    options: Option<OptionType>
) -> Result<Self, Box<DBError>>
[src]

pub fn get_header_tip_hash(&self) -> Result<Vec<u8>, Box<DBError>>[src]

pub fn get_tip_meta<HeaderType>(
    &self
) -> Result<(Meta<HeaderType>, Meta<HeaderType>), Box<DBError>> where
    HeaderType: BlockHeader + Clone + Proto<ProtoType = BlockHeader> + Encode
[src]

pub fn set_header_tip_hash(
    &mut self,
    hash: &Vec<u8>
) -> Result<(), Box<DBError>>
[src]

pub fn get_block_tip_hash(&self) -> Result<Vec<u8>, Box<DBError>>[src]

pub fn set_block_tip_hash(&mut self, hash: &Vec<u8>) -> Result<(), Box<DBError>>[src]

pub fn set_hash_using_height(
    &mut self,
    height: u32,
    hash: &Vec<u8>
) -> Result<(), Box<DBError>>
[src]

pub fn set_meta<HeaderType>(
    &mut self,
    hash: &Vec<u8>,
    meta_info: &Meta<HeaderType>
) -> Result<(), Box<DBError>> where
    HeaderType: BlockHeader + Clone + Proto + Encode
[src]

pub fn get_meta<HeaderType>(
    &self,
    hash: &Vec<u8>
) -> Result<Meta<HeaderType>, Box<DBError>> where
    HeaderType: BlockHeader + Clone + Proto<ProtoType = BlockHeader> + Encode
[src]

pub fn set_block<T>(
    &mut self,
    block: &mut T
) -> Result<WriteLocation, Box<DBError>> where
    T: Encode + Proto
[src]

pub fn get_blocks<T, HeaderType>(
    &mut self,
    from_height: u32,
    count: u32
) -> Result<Vec<T>, Box<DBError>> where
    T: Decode + Clone,
    HeaderType: BlockHeader + Encode + Clone + Proto<ProtoType = BlockHeader>, 
[src]

pub fn get_block<T, HeaderType>(
    &mut self,
    hash: &Vec<u8>
) -> Result<T, Box<DBError>> where
    T: Decode + Clone,
    HeaderType: BlockHeader + Encode + Clone + Proto<ProtoType = BlockHeader>, 
[src]

pub fn get_block_by_height<T, HeaderType>(
    &mut self,
    height: u32
) -> Result<T, Box<DBError>> where
    T: Decode + Clone,
    HeaderType: BlockHeader + Encode + Clone + Proto<ProtoType = BlockHeader>, 
[src]

pub fn set_block_status(
    &mut self,
    hash: &Vec<u8>,
    status: BlockStatus
) -> Result<(), Box<DBError>>
[src]

pub fn get_block_status(
    &self,
    hash: &Vec<u8>
) -> Result<BlockStatus, Box<DBError>>
[src]

Auto Trait Implementations

impl<BlockFileType, DatabaseType> Send for BlockDB<BlockFileType, DatabaseType> where
    BlockFileType: Send,
    DatabaseType: Send

impl<BlockFileType, DatabaseType> Sync for BlockDB<BlockFileType, DatabaseType> where
    BlockFileType: Sync,
    DatabaseType: Sync

Blanket Implementations

impl<T> From for T[src]

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> SendSyncUnwindSafe for T where
    T: Send + Sync + UnwindSafe + ?Sized

impl<T> Erased for T

impl<T> Same for T

type Output = T

Should always be Self