Struct clarity_repl::clarity::deps_common::bitcoin::blockdata::script::Script
pub struct Script(/* private fields */);Expand description
A Bitcoin script
Implementations§
§impl Script
impl Script
pub fn into_bytes(self) -> Vec<u8> ⓘ
pub fn into_bytes(self) -> Vec<u8> ⓘ
Convert the script into a byte vector
pub fn to_v0_p2wsh(&self) -> Script
pub fn to_v0_p2wsh(&self) -> Script
Compute the P2WSH output corresponding to this witnessScript (aka the “witness redeem script”)
pub fn is_v0_p2wsh(&self) -> bool
pub fn is_v0_p2wsh(&self) -> bool
Checks whether a script pubkey is a p2wsh output
pub fn is_v0_p2wpkh(&self) -> bool
pub fn is_v0_p2wpkh(&self) -> bool
Checks whether a script pubkey is a p2wpkh output
pub fn is_op_return(&self) -> bool
pub fn is_op_return(&self) -> bool
Check if this is an OP_RETURN output
pub fn is_provably_unspendable(&self) -> bool
pub fn is_provably_unspendable(&self) -> bool
Whether a script can be proven to have no satisfying input
pub fn iter(&self, enforce_minimal: bool) -> Instructions<'_> ⓘ
pub fn iter(&self, enforce_minimal: bool) -> Instructions<'_> ⓘ
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<D> ConsensusDecodable<D> for Scriptwhere
D: SimpleDecoder,
impl<D> ConsensusDecodable<D> for Scriptwhere D: SimpleDecoder,
§impl<S> ConsensusEncodable<S> for Scriptwhere
S: SimpleEncoder,
impl<S> ConsensusEncodable<S> for Scriptwhere S: SimpleEncoder,
§impl Ord for Script
impl Ord for Script
§impl PartialOrd for Script
impl PartialOrd for Script
§fn partial_cmp(&self, other: &Script) -> Option<Ordering>
fn partial_cmp(&self, other: &Script) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self and other) and is used by the <=
operator. Read moreimpl Eq for Script
impl StructuralEq for Script
impl StructuralPartialEq for Script
Auto Trait Implementations§
impl RefUnwindSafe for Script
impl Send for Script
impl Sync for Script
impl Unpin for Script
impl UnwindSafe for Script
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.§impl<T> InitializableFromZeroed for Twhere
T: Default,
impl<T> InitializableFromZeroed for Twhere T: Default,
§unsafe fn initialize(place: *mut T)
unsafe fn initialize(place: *mut T)
Called to initialize a place to a valid value, after it is set
to all-bits-zero. Read more