Struct bitcoin::blockdata::script::Script
[−]
[src]
pub struct Script(_);
A Bitcoin script
Methods
impl Script
[src]
pub fn new() -> Script
[src]
Creates a new empty script
pub fn len(&self) -> usize
[src]
The length in bytes of the script
pub fn is_empty(&self) -> bool
[src]
Whether the script is the empty script
pub fn into_vec(self) -> Vec<u8>
[src]
Convert the script into a byte vector
pub fn to_p2sh(&self) -> Script
[src]
Compute the P2SH output corresponding to this redeem script
pub fn to_v0_p2wsh(&self) -> Script
[src]
Compute the P2WSH output corresponding to this redeem script
pub fn is_p2sh(&self) -> bool
[src]
Checks whether a script pubkey is a p2sh output
pub fn is_p2pkh(&self) -> bool
[src]
Checks whether a script pubkey is a p2pkh output
pub fn is_p2pk(&self) -> bool
[src]
Checks whether a script pubkey is a p2pkh output
pub fn is_v0_p2wsh(&self) -> bool
[src]
Checks whether a script pubkey is a p2wsh output
pub fn is_v0_p2wpkh(&self) -> bool
[src]
Checks whether a script pubkey is a p2wpkh output
pub fn is_provably_unspendable(&self) -> bool
[src]
Whether a script can be proven to have no satisfying input
Trait Implementations
impl Clone for Script
[src]
fn clone(&self) -> Script
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl PartialEq for Script
[src]
fn eq(&self, __arg_0: &Script) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &Script) -> bool
[src]
This method tests for !=
.
impl Eq for Script
[src]
impl Hash for Script
[src]
fn hash<__H: Hasher>(&self, __arg_0: &mut __H)
[src]
Feeds this value into the given [Hasher
]. Read more
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
Feeds a slice of this type into the given [Hasher
]. Read more
impl Debug for Script
[src]
fn fmt(&self, f: &mut Formatter) -> Result
[src]
Formats the value using the given formatter. Read more
impl Display for Script
[src]
fn fmt(&self, f: &mut Formatter) -> Result
[src]
Formats the value using the given formatter. Read more
impl LowerHex for Script
[src]
impl UpperHex for Script
[src]
impl Default for Script
[src]
impl From<Vec<u8>> for Script
[src]
Creates a new script from an existing vector
impl Index<Range<usize>> for Script
[src]
type Output = [u8]
The returned type after indexing.
fn index(&self, index: Range<usize>) -> &[u8]
[src]
Performs the indexing (container[index]
) operation.
impl Index<RangeTo<usize>> for Script
[src]
type Output = [u8]
The returned type after indexing.
fn index(&self, index: RangeTo<usize>) -> &[u8]
[src]
Performs the indexing (container[index]
) operation.
impl Index<RangeFrom<usize>> for Script
[src]
type Output = [u8]
The returned type after indexing.
fn index(&self, index: RangeFrom<usize>) -> &[u8]
[src]
Performs the indexing (container[index]
) operation.
impl Index<RangeFull> for Script
[src]
type Output = [u8]
The returned type after indexing.
fn index(&self, _: RangeFull) -> &[u8]
[src]
Performs the indexing (container[index]
) operation.
impl<'a> IntoIterator for &'a Script
[src]
type Item = Instruction<'a>
The type of the elements being iterated over.
type IntoIter = Instructions<'a>
Which kind of iterator are we turning this into?
ⓘImportant traits for Instructions<'a>fn into_iter(self) -> Instructions<'a>
[src]
Creates an iterator from a value. Read more
impl Serialize for Script
[src]
fn serialize<S>(&self, s: &mut S) -> Result<(), S::Error> where
S: Serializer,
[src]
S: Serializer,
Serializes this value into this serializer.
impl Deserialize for Script
[src]
fn deserialize<D>(d: &mut D) -> Result<Script, D::Error> where
D: Deserializer,
[src]
D: Deserializer,
Deserialize this value given this Deserializer
.
impl<S: SimpleEncoder> ConsensusEncodable<S> for Script
[src]
fn consensus_encode(&self, s: &mut S) -> Result<(), S::Error>
[src]
Encode an object with a well-defined format