[−][src]Struct hycon_rust::database::block_db::BlockDB
Methods
impl<BlockFileType, DatabaseType, OptionType> BlockDB<BlockFileType, DatabaseType> where
BlockFileType: BlockFileOps,
DatabaseType: IDB<OptionType = OptionType>,
[src]
BlockFileType: BlockFileOps,
DatabaseType: IDB<OptionType = OptionType>,
pub fn new(
db_path: PathBuf,
file_path: PathBuf,
db_keys: DBKeys,
options: Option<OptionType>
) -> Result<Self, Box<DBError>>
[src]
db_path: PathBuf,
file_path: PathBuf,
db_keys: DBKeys,
options: Option<OptionType>
) -> Result<Self, Box<DBError>>
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]
&self
) -> Result<(Meta<HeaderType>, Meta<HeaderType>), Box<DBError>> where
HeaderType: BlockHeader + Clone + Proto<ProtoType = BlockHeader> + Encode,
pub fn set_header_tip_hash(
&mut self,
hash: &Vec<u8>
) -> Result<(), Box<DBError>>
[src]
&mut self,
hash: &Vec<u8>
) -> Result<(), Box<DBError>>
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]
&mut self,
height: u32,
hash: &Vec<u8>
) -> Result<(), Box<DBError>>
pub fn set_meta<HeaderType>(
&mut self,
hash: &Vec<u8>,
meta_info: &Meta<HeaderType>
) -> Result<(), Box<DBError>> where
HeaderType: BlockHeader + Clone + Proto + Encode,
[src]
&mut self,
hash: &Vec<u8>,
meta_info: &Meta<HeaderType>
) -> Result<(), Box<DBError>> where
HeaderType: BlockHeader + Clone + Proto + Encode,
pub fn get_meta<HeaderType>(
&self,
hash: &Vec<u8>
) -> Result<Meta<HeaderType>, Box<DBError>> where
HeaderType: BlockHeader + Clone + Proto<ProtoType = BlockHeader> + Encode,
[src]
&self,
hash: &Vec<u8>
) -> Result<Meta<HeaderType>, Box<DBError>> where
HeaderType: BlockHeader + Clone + Proto<ProtoType = BlockHeader> + Encode,
pub fn set_block<T>(
&mut self,
block: &mut T
) -> Result<WriteLocation, Box<DBError>> where
T: Encode + Proto,
[src]
&mut self,
block: &mut T
) -> Result<WriteLocation, Box<DBError>> where
T: Encode + Proto,
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]
&mut self,
from_height: u32,
count: u32
) -> Result<Vec<T>, Box<DBError>> where
T: Decode + Clone,
HeaderType: BlockHeader + Encode + Clone + Proto<ProtoType = BlockHeader>,
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]
&mut self,
hash: &Vec<u8>
) -> Result<T, Box<DBError>> where
T: Decode + Clone,
HeaderType: BlockHeader + Encode + Clone + Proto<ProtoType = BlockHeader>,
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]
&mut self,
height: u32
) -> Result<T, Box<DBError>> where
T: Decode + Clone,
HeaderType: BlockHeader + Encode + Clone + Proto<ProtoType = BlockHeader>,
pub fn set_block_status(
&mut self,
hash: &Vec<u8>,
status: BlockStatus
) -> Result<(), Box<DBError>>
[src]
&mut self,
hash: &Vec<u8>,
status: BlockStatus
) -> Result<(), Box<DBError>>
pub fn get_block_status(
&self,
hash: &Vec<u8>
) -> Result<BlockStatus, Box<DBError>>
[src]
&self,
hash: &Vec<u8>
) -> Result<BlockStatus, Box<DBError>>
Auto Trait Implementations
impl<BlockFileType, DatabaseType> Send for BlockDB<BlockFileType, DatabaseType> where
BlockFileType: Send,
DatabaseType: Send,
BlockFileType: Send,
DatabaseType: Send,
impl<BlockFileType, DatabaseType> Sync for BlockDB<BlockFileType, DatabaseType> where
BlockFileType: Sync,
DatabaseType: Sync,
BlockFileType: Sync,
DatabaseType: Sync,
Blanket Implementations
impl<T> From for T
[src]
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> SendSyncUnwindSafe for T where
T: Send + Sync + UnwindSafe + ?Sized,
T: Send + Sync + UnwindSafe + ?Sized,
impl<T> Erased for T
impl<T> Same for T
type Output = T
Should always be Self