[−][src]Struct hycon_rust::common::block::Block
Fields
header: HeaderType
txs: Option<Vec<TxType>>
meta: Option<Meta<HeaderType>>
Methods
impl<HeaderType, TxType> Block<HeaderType, TxType> where
HeaderType: Clone + Encode + BlockHeader + Proto,
[src]
HeaderType: Clone + Encode + BlockHeader + Proto,
pub fn new(
header: HeaderType,
txs: Option<Vec<TxType>>,
meta: Option<Meta<HeaderType>>
) -> Block<HeaderType, TxType>
[src]
header: HeaderType,
txs: Option<Vec<TxType>>,
meta: Option<Meta<HeaderType>>
) -> Block<HeaderType, TxType>
pub fn from_header(header: HeaderType) -> Block<HeaderType, TxType>
[src]
pub fn save(&self) -> Result<ProtoBlockDB, Box<dyn Error>>
[src]
Trait Implementations
impl HyconConsensus<Header, Block<Header, SignedTx>> for Consensus
[src]
fn init(&mut self) -> Result<(), Box<dyn Error>>
[src]
fn get_header_tip_height(&self) -> Result<u32, Box<dyn Error>>
[src]
fn get_block_tip_height(&self) -> Result<u32, Box<dyn Error>>
[src]
fn get_block_tip_total_work(&self) -> Result<f64, Box<dyn Error>>
[src]
fn get_header_tip_total_work(&self) -> Result<f64, Box<dyn Error>>
[src]
fn get_tip_hash(&self) -> Result<Vec<u8>, Box<dyn Error>>
[src]
fn put(
&mut self,
_header: Header,
_block: Option<Block<Header, SignedTx>>
) -> Result<(), Box<dyn Error>>
[src]
&mut self,
_header: Header,
_block: Option<Block<Header, SignedTx>>
) -> Result<(), Box<dyn Error>>
fn check_hash_at_height(
&self,
hash: &Vec<u8>,
height: u32
) -> Result<BlockStatus, Box<dyn Error>>
[src]
&self,
hash: &Vec<u8>,
height: u32
) -> Result<BlockStatus, Box<dyn Error>>
impl Encode for Block<Header, SignedTx>
[src]
impl Decode for Block<Header, SignedTx>
[src]
impl Decode for Block<GenesisHeader, SignedGenesisTx>
[src]
impl Decode for Block<GenesisHeader, ExodusTx>
[src]
impl Proto for Block<Header, SignedTx>
[src]
type ProtoType = ProtoBlock
fn to_proto(&self) -> Result<Self::ProtoType, Box<dyn Error>>
[src]
fn from_proto(block: &ProtoBlock) -> Result<Self, Box<dyn Error>>
[src]
impl<HeaderType: Clone, TxType: Clone> Clone for Block<HeaderType, TxType> where
HeaderType: BlockHeader + Encode + Clone + Proto,
[src]
HeaderType: BlockHeader + Encode + Clone + Proto,
fn clone(&self) -> Block<HeaderType, TxType>
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl<HeaderType: Debug, TxType: Debug> Debug for Block<HeaderType, TxType> where
HeaderType: BlockHeader + Encode + Clone + Proto,
[src]
HeaderType: BlockHeader + Encode + Clone + Proto,
Auto Trait Implementations
impl<HeaderType, TxType> Send for Block<HeaderType, TxType> where
HeaderType: Send,
TxType: Send,
HeaderType: Send,
TxType: Send,
impl<HeaderType, TxType> Sync for Block<HeaderType, TxType> where
HeaderType: Sync,
TxType: Sync,
HeaderType: Sync,
TxType: 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> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
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