pub struct BlockHeader { /* private fields */ }Expand description
This header type encapsulates a header and its hash to avoid recomputing
Implementations§
Source§impl BlockHeader
impl BlockHeader
pub fn header(&self) -> &Header
pub fn header_body(&self) -> &HeaderBody
pub fn parent_hash(&self) -> Option<HeaderHash>
pub fn tip(&self) -> Tip
Trait Implementations§
Source§impl Clone for BlockHeader
impl Clone for BlockHeader
Source§fn clone(&self) -> BlockHeader
fn clone(&self) -> BlockHeader
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for BlockHeader
impl Debug for BlockHeader
Source§impl<'b, C> Decode<'b, C> for BlockHeader
impl<'b, C> Decode<'b, C> for BlockHeader
Source§impl<'de> Deserialize<'de> for BlockHeader
impl<'de> Deserialize<'de> for BlockHeader
Source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for BlockHeader
impl Display for BlockHeader
Source§impl<C> Encode<C> for BlockHeader
impl<C> Encode<C> for BlockHeader
Source§impl From<&PseudoHeader<HeaderBody>> for BlockHeader
impl From<&PseudoHeader<HeaderBody>> for BlockHeader
Source§impl From<PseudoHeader<HeaderBody>> for BlockHeader
impl From<PseudoHeader<HeaderBody>> for BlockHeader
Source§impl Hash for BlockHeader
impl Hash for BlockHeader
Source§impl Ord for BlockHeader
impl Ord for BlockHeader
Source§impl PartialEq for BlockHeader
impl PartialEq for BlockHeader
Source§impl PartialOrd for BlockHeader
impl PartialOrd for BlockHeader
Source§impl Serialize for BlockHeader
We serialize both the hash and the header, but we use serde’s flattening
to avoid nesting the header inside another object.
impl Serialize for BlockHeader
We serialize both the hash and the header, but we use serde’s flattening to avoid nesting the header inside another object.
impl Eq for BlockHeader
impl StructuralPartialEq for BlockHeader
Auto Trait Implementations§
impl Freeze for BlockHeader
impl RefUnwindSafe for BlockHeader
impl Send for BlockHeader
impl Sync for BlockHeader
impl Unpin for BlockHeader
impl UnsafeUnpin for BlockHeader
impl UnwindSafe for BlockHeader
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more