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