pub struct RawHeader(/* private fields */);Expand description
A raw bitcoin header.
Implementations§
Source§impl RawHeader
impl RawHeader
Sourcepub fn new<T: AsRef<[u8]>>(buf: &T) -> Result<Self, SPVError>
pub fn new<T: AsRef<[u8]>>(buf: &T) -> Result<Self, SPVError>
Try to instantiate a new RawHeader from some bytes. Errors if the bytearray is not 80 bytes or more.
Sourcepub fn digest(&self) -> Hash256Digest
pub fn digest(&self) -> Hash256Digest
Calculate the LE header digest
Sourcepub fn tx_root(&self) -> Hash256Digest
pub fn tx_root(&self) -> Hash256Digest
Extract the LE tx merkle root from the header
Sourcepub fn difficulty(&self) -> U256
pub fn difficulty(&self) -> U256
Extract the difficulty from the header
Sourcepub fn parent(&self) -> Hash256Digest
pub fn parent(&self) -> Hash256Digest
Extract the LE parent digest from the header
Trait Implementations§
Source§impl<'de> Deserialize<'de> for RawHeader
impl<'de> Deserialize<'de> for RawHeader
Source§fn deserialize<D>(deserializer: D) -> Result<RawHeader, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<RawHeader, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Copy for RawHeader
impl Eq for RawHeader
Auto Trait Implementations§
impl Freeze for RawHeader
impl RefUnwindSafe for RawHeader
impl Send for RawHeader
impl Sync for RawHeader
impl Unpin for RawHeader
impl UnwindSafe for RawHeader
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