pub struct RedeemScript(/* private fields */);
Expand description
Redeem script as part of the witness
or scriptSig
structure; it is
hashed for P2(W)SH output.
Implementations§
Source§impl RedeemScript
impl RedeemScript
Sourcepub fn script_hash(&self) -> ScriptHash
pub fn script_hash(&self) -> ScriptHash
Computes script commitment hash which participates in PubkeyScript
Sourcepub fn to_p2sh(&self) -> PubkeyScript
pub fn to_p2sh(&self) -> PubkeyScript
Generates PubkeyScript
matching given redeemScript
Trait Implementations§
Source§impl AsMut<<RedeemScript as Wrapper>::Inner> for RedeemScript
impl AsMut<<RedeemScript as Wrapper>::Inner> for RedeemScript
Source§impl AsRef<<RedeemScript as Wrapper>::Inner> for RedeemScript
impl AsRef<<RedeemScript as Wrapper>::Inner> for RedeemScript
Source§impl Borrow<<RedeemScript as Wrapper>::Inner> for RedeemScript
impl Borrow<<RedeemScript as Wrapper>::Inner> for RedeemScript
Source§impl BorrowMut<<RedeemScript as Wrapper>::Inner> for RedeemScript
impl BorrowMut<<RedeemScript as Wrapper>::Inner> for RedeemScript
Source§impl Clone for RedeemScript
impl Clone for RedeemScript
Source§fn clone(&self) -> RedeemScript
fn clone(&self) -> RedeemScript
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for RedeemScript
impl Debug for RedeemScript
Source§impl Default for RedeemScript
impl Default for RedeemScript
Source§fn default() -> RedeemScript
fn default() -> RedeemScript
Returns the “default value” for a type. Read more
Source§impl Deref for RedeemScript
impl Deref for RedeemScript
Source§impl DerefMut for RedeemScript
impl DerefMut for RedeemScript
Source§impl Display for RedeemScript
impl Display for RedeemScript
Source§impl From<LockScript> for RedeemScript
impl From<LockScript> for RedeemScript
Source§fn from(lock_script: LockScript) -> Self
fn from(lock_script: LockScript) -> Self
Converts to this type from the input type.
Source§impl From<RedeemScript> for LockScript
impl From<RedeemScript> for LockScript
Source§fn from(redeem_script: RedeemScript) -> Self
fn from(redeem_script: RedeemScript) -> Self
Converts to this type from the input type.
Source§impl From<RedeemScript> for Script
impl From<RedeemScript> for Script
Source§fn from(wrapped: RedeemScript) -> Self
fn from(wrapped: RedeemScript) -> Self
Converts to this type from the input type.
Source§impl From<RedeemScript> for SigScript
impl From<RedeemScript> for SigScript
Source§fn from(redeem_script: RedeemScript) -> Self
fn from(redeem_script: RedeemScript) -> Self
Converts to this type from the input type.
Source§impl From<Script> for RedeemScript
impl From<Script> for RedeemScript
Source§impl From<WitnessScript> for RedeemScript
impl From<WitnessScript> for RedeemScript
Source§fn from(witness_script: WitnessScript) -> Self
fn from(witness_script: WitnessScript) -> Self
Converts to this type from the input type.
Source§impl Hash for RedeemScript
impl Hash for RedeemScript
Source§impl LowerHex for RedeemScript
impl LowerHex for RedeemScript
Source§impl Ord for RedeemScript
impl Ord for RedeemScript
Source§fn cmp(&self, other: &RedeemScript) -> Ordering
fn cmp(&self, other: &RedeemScript) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for RedeemScript
impl PartialEq for RedeemScript
Source§impl PartialOrd for RedeemScript
impl PartialOrd for RedeemScript
Source§impl Strategy for RedeemScript
impl Strategy for RedeemScript
Source§impl ToPubkeyScript for RedeemScript
impl ToPubkeyScript for RedeemScript
Source§fn to_pubkey_script(&self, strategy: ConvertInfo) -> Option<PubkeyScript>
fn to_pubkey_script(&self, strategy: ConvertInfo) -> Option<PubkeyScript>
Generates scriptPubkey
matching the given RedeemScript
. Fails by
returning None
for the following contexts, where redeemScript
is not
present:
Source§impl UpperHex for RedeemScript
impl UpperHex for RedeemScript
Source§impl Wrapper for RedeemScript
impl Wrapper for RedeemScript
Source§fn from_inner(inner: Self::Inner) -> Self
fn from_inner(inner: Self::Inner) -> Self
Instantiates wrapper type with the inner data
Source§fn as_inner(&self) -> &Self::Inner
fn as_inner(&self) -> &Self::Inner
Returns reference to the inner representation for the wrapper type
Source§fn as_inner_mut(&mut self) -> &mut Self::Inner
fn as_inner_mut(&mut self) -> &mut Self::Inner
Returns a mutable reference to the inner representation for the wrapper
type
Source§fn into_inner(self) -> Self::Inner
fn into_inner(self) -> Self::Inner
Unwraps the wrapper returning the inner type
impl Eq for RedeemScript
impl StructuralPartialEq for RedeemScript
Auto Trait Implementations§
impl Freeze for RedeemScript
impl RefUnwindSafe for RedeemScript
impl Send for RedeemScript
impl Sync for RedeemScript
impl Unpin for RedeemScript
impl UnwindSafe for RedeemScript
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<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> StrictDecode for T
impl<T> StrictDecode for T
Source§fn strict_decode<D>(d: D) -> Result<T, Error>where
D: Read,
fn strict_decode<D>(d: D) -> Result<T, Error>where
D: Read,
Decode with the given
std::io::Read
instance; must either
construct an instance or return implementation-specific error type.Source§fn strict_deserialize(data: impl AsRef<[u8]>) -> Result<Self, Error>
fn strict_deserialize(data: impl AsRef<[u8]>) -> Result<Self, Error>
Tries to deserialize byte array into the current type using
StrictDecode::strict_decode
. If there are some data remains in the
buffer once deserialization is completed, fails with
Error::DataNotEntirelyConsumed
. Use io::Cursor
over the buffer and
StrictDecode::strict_decode
to avoid such failures.Source§fn strict_file_load(path: impl AsRef<Path>) -> Result<Self, Error>
fn strict_file_load(path: impl AsRef<Path>) -> Result<Self, Error>
Reads data from file at
path
and reconstructs object from it. Fails
with Error::DataNotEntirelyConsumed
if file contains remaining
data after the object reconstruction.Source§impl<T> StrictEncode for T
impl<T> StrictEncode for T
Source§fn strict_encode<E>(&self, e: E) -> Result<usize, Error>where
E: Write,
fn strict_encode<E>(&self, e: E) -> Result<usize, Error>where
E: Write,
Encode with the given
std::io::Write
instance; must return result
with either amount of bytes encoded – or implementation-specific
error type.Source§fn strict_serialize(&self) -> Result<Vec<u8>, Error>
fn strict_serialize(&self) -> Result<Vec<u8>, Error>
Serializes data as a byte array using
StrictEncode::strict_encode
function