Enum bp::WitnessVer
source · #[repr(u8)]pub enum WitnessVer {
Show 17 variants
V0,
V1,
V2,
V3,
V4,
V5,
V6,
V7,
V8,
V9,
V10,
V11,
V12,
V13,
V14,
V15,
V16,
}
Expand description
Version of the witness program.
First byte of scriptPubkey
in transaction output for transactions starting
with 0 and 0x51-0x60 (inclusive).
Variants§
V0
Initial version of witness program. Used for P2WPKH and P2WPK outputs
V1
Version of witness program used for Taproot P2TR outputs.
V2
Future (unsupported) version of witness program.
V3
Future (unsupported) version of witness program.
V4
Future (unsupported) version of witness program.
V5
Future (unsupported) version of witness program.
V6
Future (unsupported) version of witness program.
V7
Future (unsupported) version of witness program.
V8
Future (unsupported) version of witness program.
V9
Future (unsupported) version of witness program.
V10
Future (unsupported) version of witness program.
V11
Future (unsupported) version of witness program.
V12
Future (unsupported) version of witness program.
V13
Future (unsupported) version of witness program.
V14
Future (unsupported) version of witness program.
V15
Future (unsupported) version of witness program.
V16
Future (unsupported) version of witness program.
Implementations§
source§impl WitnessVer
impl WitnessVer
sourcepub fn from_op_code(op_code: OpCode) -> Result<WitnessVer, SegwitError>
pub fn from_op_code(op_code: OpCode) -> Result<WitnessVer, SegwitError>
Converts bitcoin script opcode into WitnessVer
variant.
Returns
Version of the Witness program.
Errors
If the opcode does not correspond to any witness version, errors with
SegwitError::MalformedWitnessVersion
.
sourcepub fn op_code(self) -> OpCode
pub fn op_code(self) -> OpCode
Converts WitnessVer
instance into corresponding Bitcoin op-code.
Trait Implementations§
source§impl Clone for WitnessVer
impl Clone for WitnessVer
source§fn clone(&self) -> WitnessVer
fn clone(&self) -> WitnessVer
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for WitnessVer
impl Debug for WitnessVer
source§impl Display for WitnessVer
impl Display for WitnessVer
source§impl Hash for WitnessVer
impl Hash for WitnessVer
source§impl Ord for WitnessVer
impl Ord for WitnessVer
source§fn cmp(&self, other: &WitnessVer) -> Ordering
fn cmp(&self, other: &WitnessVer) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere Self: Sized,
source§impl PartialEq<WitnessVer> for WitnessVer
impl PartialEq<WitnessVer> for WitnessVer
source§fn eq(&self, other: &WitnessVer) -> bool
fn eq(&self, other: &WitnessVer) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd<WitnessVer> for WitnessVer
impl PartialOrd<WitnessVer> for WitnessVer
source§fn partial_cmp(&self, other: &WitnessVer) -> Option<Ordering>
fn partial_cmp(&self, other: &WitnessVer) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read moreimpl Copy for WitnessVer
impl Eq for WitnessVer
impl StructuralEq for WitnessVer
impl StructuralPartialEq for WitnessVer
Auto Trait Implementations§
impl RefUnwindSafe for WitnessVer
impl Send for WitnessVer
impl Sync for WitnessVer
impl Unpin for WitnessVer
impl UnwindSafe for WitnessVer
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
§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.