[−][src]Struct sv::messages::BlockHeader
Block header
Fields
version: u32
Block version specifying which validation rules to use
prev_hash: Hash256
Hash of the previous block
merkle_root: Hash256
Root of the merkle tree of this block's transaction hashes
timestamp: u32
Timestamp when this block was created as recorded by the miner
bits: u32
Target difficulty bits
nonce: u32
Nonce used to mine the block
Implementations
impl BlockHeader
[src]
pub const SIZE: usize
[src]
Size of the BlockHeader in bytes
pub fn size(&self) -> usize
[src]
Returns the size of the block header in bytes
pub fn hash(&self) -> Hash256
[src]
Calculates the hash for this block header
pub fn validate(
&self,
hash: &Hash256,
prev_headers: &[BlockHeader]
) -> Result<()>
[src]
&self,
hash: &Hash256,
prev_headers: &[BlockHeader]
) -> Result<()>
Checks that the block header is valid
Trait Implementations
impl Clone for BlockHeader
[src]
fn clone(&self) -> BlockHeader
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for BlockHeader
[src]
impl Default for BlockHeader
[src]
fn default() -> BlockHeader
[src]
impl Eq for BlockHeader
[src]
impl Hash for BlockHeader
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl PartialEq<BlockHeader> for BlockHeader
[src]
fn eq(&self, other: &BlockHeader) -> bool
[src]
fn ne(&self, other: &BlockHeader) -> bool
[src]
impl Serializable<BlockHeader> for BlockHeader
[src]
fn read(reader: &mut dyn Read) -> Result<BlockHeader>
[src]
fn write(&self, writer: &mut dyn Write) -> Result<()>
[src]
impl StructuralEq for BlockHeader
[src]
impl StructuralPartialEq for BlockHeader
[src]
Auto Trait Implementations
impl RefUnwindSafe for BlockHeader
impl Send for BlockHeader
impl Sync for BlockHeader
impl Unpin for BlockHeader
impl UnwindSafe for BlockHeader
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
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<U> 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, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,