Struct bitcoin_bech32::WitnessProgram[][src]

pub struct WitnessProgram { /* fields omitted */ }

Witness version and program data

Methods

impl WitnessProgram
[src]

Construct a new WitnessProgram given the constituent version, witness program and network version

Converts a Witness Program to a SegWit Address

Decodes a segwit address into a Witness Program

Verifies that the address contains a known human-readable part hrp and decodes as proper Bech32-encoded string. Allowed values of the human-readable part correspond to the defined types in constants

Important traits for Vec<u8>

Converts a WitnessProgram to a script public key

The format for the output is [version, program length, <program>]

Extracts a WitnessProgram out of a provided script public key

Validates the WitnessProgram against version and length constraints

Witness program version

Important traits for &'a [u8]

Witness program serialized as 8-bit bytes

Which network this witness program is intended to be run on

Trait Implementations

impl PartialEq for WitnessProgram
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

impl Eq for WitnessProgram
[src]

impl Debug for WitnessProgram
[src]

Formats the value using the given formatter. Read more

impl Clone for WitnessProgram
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl PartialOrd for WitnessProgram
[src]

This method returns an ordering between self and other values if one exists. Read more

This method tests less than (for self and other) and is used by the < operator. Read more

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

This method tests greater than (for self and other) and is used by the > operator. Read more

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

impl Ord for WitnessProgram
[src]

This method returns an Ordering between self and other. Read more

Compares and returns the maximum of two values. Read more

Compares and returns the minimum of two values. Read more

impl Hash for WitnessProgram
[src]

Feeds this value into the given [Hasher]. Read more

Feeds a slice of this type into the given [Hasher]. Read more

impl ToString for WitnessProgram
[src]

Converts the given value to a String. Read more

impl FromStr for WitnessProgram
[src]

The associated error which can be returned from parsing.

Parses a string s to return a value of this type. Read more

Auto Trait Implementations