Struct bitcoin::blockdata::script::Script[][src]

pub struct Script(_);

A Bitcoin script

Methods

impl Script
[src]

Creates a new empty script

The length in bytes of the script

Whether the script is the empty script

Returns the script data

Returns a copy of the script data

Convert the script into a byte vector

Compute the P2SH output corresponding to this redeem script

Compute the P2WSH output corresponding to this witnessScript (aka the "witness redeem script")

Checks whether a script pubkey is a p2sh output

Checks whether a script pubkey is a p2pkh output

Checks whether a script pubkey is a p2pkh output

Checks whether a script pubkey is a p2wsh output

Checks whether a script pubkey is a p2wpkh output

Check if this is an OP_RETURN output

Whether a script can be proven to have no satisfying input

Important traits for Instructions<'a>

Iterate over the script in the form of Instructions, which are an enum covering opcodes, datapushes and errors. At most one error will be returned and then the iterator will end. To instead iterate over the script as sequence of bytes, treat it as a slice using script[..] or convert it to a vector using into_bytes().

Trait Implementations

impl Clone for Script
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Default for Script
[src]

Returns the "default value" for a type. Read more

impl PartialOrd for Script
[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 Script
[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 PartialEq for Script
[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 Script
[src]

impl Hash for Script
[src]

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

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

impl Debug for Script
[src]

Formats the value using the given formatter. Read more

impl Display for Script
[src]

Formats the value using the given formatter. Read more

impl LowerHex for Script
[src]

Formats the value using the given formatter.

impl UpperHex for Script
[src]

Formats the value using the given formatter.

impl From<Vec<u8>> for Script
[src]

Creates a new script from an existing vector

Performs the conversion.

impl Index<Range<usize>> for Script
[src]

The returned type after indexing.

Performs the indexing (container[index]) operation.

impl Index<RangeTo<usize>> for Script
[src]

The returned type after indexing.

Performs the indexing (container[index]) operation.

impl Index<RangeFrom<usize>> for Script
[src]

The returned type after indexing.

Performs the indexing (container[index]) operation.

impl Index<RangeFull> for Script
[src]

The returned type after indexing.

Performs the indexing (container[index]) operation.

impl<S: SimpleEncoder> ConsensusEncodable<S> for Script
[src]

Encode an object with a well-defined format

impl<D: SimpleDecoder> ConsensusDecodable<D> for Script
[src]

Decode an object with a well-defined format

Auto Trait Implementations

impl Send for Script

impl Sync for Script