Enum bitcoin::util::taproot::LeafVersion
source · pub enum LeafVersion {
TapScript,
Future(FutureLeafVersion),
}
Expand description
The leaf version for tapleafs.
Variants§
Implementations§
source§impl LeafVersion
impl LeafVersion
sourcepub fn from_consensus(version: u8) -> Result<Self, TaprootError>
pub fn from_consensus(version: u8) -> Result<Self, TaprootError>
Creates a LeafVersion
from consensus byte representation.
Errors
- If the last bit of the
version
is odd. - If the
version
is 0x50 (TAPROOT_ANNEX_PREFIX
).
sourcepub fn to_consensus(self) -> u8
pub fn to_consensus(self) -> u8
Returns the consensus representation of this LeafVersion
.
Trait Implementations§
source§impl Clone for LeafVersion
impl Clone for LeafVersion
source§fn clone(&self) -> LeafVersion
fn clone(&self) -> LeafVersion
Returns a copy 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 LeafVersion
impl Debug for LeafVersion
source§impl<'de> Deserialize<'de> for LeafVersion
impl<'de> Deserialize<'de> for LeafVersion
Deserializes LeafVersion
as a u8
using consensus encoding.
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 LeafVersion
impl Display for LeafVersion
source§impl Hash for LeafVersion
impl Hash for LeafVersion
source§impl LowerHex for LeafVersion
impl LowerHex for LeafVersion
source§impl Ord for LeafVersion
impl Ord for LeafVersion
source§fn cmp(&self, other: &LeafVersion) -> Ordering
fn cmp(&self, other: &LeafVersion) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere Self: Sized,
Compares and returns the maximum of two values. Read more
source§impl PartialEq<LeafVersion> for LeafVersion
impl PartialEq<LeafVersion> for LeafVersion
source§fn eq(&self, other: &LeafVersion) -> bool
fn eq(&self, other: &LeafVersion) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd<LeafVersion> for LeafVersion
impl PartialOrd<LeafVersion> for LeafVersion
source§fn partial_cmp(&self, other: &LeafVersion) -> Option<Ordering>
fn partial_cmp(&self, other: &LeafVersion) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moresource§impl Serialize for LeafVersion
impl Serialize for LeafVersion
Serializes LeafVersion
as a u8
using consensus encoding.
source§impl UpperHex for LeafVersion
impl UpperHex for LeafVersion
impl Copy for LeafVersion
impl Eq for LeafVersion
impl StructuralEq for LeafVersion
impl StructuralPartialEq for LeafVersion
Auto Trait Implementations§
impl RefUnwindSafe for LeafVersion
impl Send for LeafVersion
impl Sync for LeafVersion
impl Unpin for LeafVersion
impl UnwindSafe for LeafVersion
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