Enum wallet::WitnessVersion[][src]

#[repr(u8)]
pub enum WitnessVersion {
Show variants V0, V1, V2, V3, V4, V5, V6, V7, V8, V9, V10, V11, V12, V13, V14, V15, V16,
}

Version of the WitnessProgram: first byte of scriptPubkey in transaction output for transactions starting with opcodes ranging from 0 to 16 (inclusive).

Structure helps to limit possible version of the witness according to the specification; if a plain u8 type will be used instead it will mean that version > 16, which is incorrect.

Variants

V0

Current, initial version of Witness Program. Used for P2WPKH and P2WPK outputs

V1

Forthcoming second version of Witness Program, which (most probably) will be used for Taproot

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

Trait Implementations

impl Clone for WitnessVersion[src]

impl Copy for WitnessVersion[src]

impl Debug for WitnessVersion[src]

impl Display for WitnessVersion[src]

impl Eq for WitnessVersion[src]

impl FromStr for WitnessVersion[src]

type Err = WitnessVersionError

The associated error which can be returned from parsing.

impl Hash for WitnessVersion[src]

impl Ord for WitnessVersion[src]

impl PartialEq<WitnessVersion> for WitnessVersion[src]

impl PartialOrd<WitnessVersion> for WitnessVersion[src]

impl StructuralEq for WitnessVersion[src]

impl StructuralPartialEq for WitnessVersion[src]

impl TryFrom<All> for WitnessVersion[src]

type Error = WitnessVersionError

The type returned in the event of a conversion error.

fn try_from(value: All) -> Result<Self, Self::Error>[src]

Takes bitcoin Script opcode and returns either corresponding version of the Witness program (for opcodes in range of OP_0..OP_16) or WitnessVersionError::IncorrectOpcode error for the rest of opcodes

impl<'a> TryFrom<Instruction<'a>> for WitnessVersion[src]

type Error = WitnessVersionError

The type returned in the event of a conversion error.

fn try_from(instruction: Instruction<'a>) -> Result<Self, Self::Error>[src]

Takes bitcoin Script instruction (parsed opcode) and returns either corresponding version of the Witness program (for push-num instructions) or WitnessVersionError::IncorrectOpcode error for the rest of opcodes

impl TryFrom<u8> for WitnessVersion[src]

type Error = WitnessVersionError

The type returned in the event of a conversion error.

fn try_from(value: u8) -> Result<Self, Self::Error>[src]

Takes bitcoin Script value and returns either corresponding version of the Witness program (for opcodes in range of OP_0..OP_16) or WitnessVersionError::IncorrectOpcode error for the rest of opcodes

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.