pub enum HeaderFamily {
Stock,
Blake2bV2,
}Expand description
The two header families of SPEC 3.2, named after the header they carry.
Variants§
Stock
Stock 80-byte header, SHA-256d: beside btc or tbtc4
(family: 'stock' in siding/lib/parents.mjs).
Blake2bV2
Knots 164-byte v2 header, BLAKE2b: beside xbt or txbt4
(family: 'blake2b').
Implementations§
Source§impl HeaderFamily
impl HeaderFamily
Sourcepub const fn pow_hash_name(self) -> &'static str
pub const fn pow_hash_name(self) -> &'static str
The kernel’s name for the family’s proof-of-work hash: sha256d or
knots:blake2b-v2.
Sourcepub const fn from_version(version: u32) -> HeaderFamily
pub const fn from_version(version: u32) -> HeaderFamily
The family a version word claims: bit 31 set means v2. This is the
kernel’s structVariants selector, useful when the bytes’ provenance
is unknown; a validator knows its family from the chain document’s
parent and should use HeaderFamily::decode with that.
Trait Implementations§
Source§impl Clone for HeaderFamily
impl Clone for HeaderFamily
impl Copy for HeaderFamily
Source§impl Debug for HeaderFamily
impl Debug for HeaderFamily
Source§impl Display for HeaderFamily
impl Display for HeaderFamily
impl Eq for HeaderFamily
Source§impl Hash for HeaderFamily
impl Hash for HeaderFamily
Source§impl PartialEq for HeaderFamily
impl PartialEq for HeaderFamily
impl StructuralPartialEq for HeaderFamily
Auto Trait Implementations§
impl Freeze for HeaderFamily
impl RefUnwindSafe for HeaderFamily
impl Send for HeaderFamily
impl Sync for HeaderFamily
impl Unpin for HeaderFamily
impl UnsafeUnpin for HeaderFamily
impl UnwindSafe for HeaderFamily
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.