Struct wallet::script::LockScript [−][src]
Script whose knowledge is required for spending some specific transaction output. This is the deepest nested version of Bitcoin script containing no hashes of other scripts, including P2SH redeemScript hashes or witnessProgram (hash or witness script), or public key hashes
Implementations
impl LockScript[src]
pub fn extract_pubkeyset<Ctx>(
&self
) -> Result<BTreeSet<PublicKey>, PubkeyParseError> where
Ctx: ScriptContext, [src]
&self
) -> Result<BTreeSet<PublicKey>, PubkeyParseError> where
Ctx: ScriptContext,
Returns set of unique public keys from the script; fails on public key hash
pub fn extract_pubkey_hash_set<Ctx>(
&self
) -> Result<(BTreeSet<PublicKey>, BTreeSet<PubkeyHash>), PubkeyParseError> where
Ctx: ScriptContext, [src]
&self
) -> Result<(BTreeSet<PublicKey>, BTreeSet<PubkeyHash>), PubkeyParseError> where
Ctx: ScriptContext,
Returns tuple of two sets: one for unique public keys and one for unique hash values, extracted from the script
pub fn extract_pubkeys_and_hashes<Ctx>(
&self
) -> Result<(Vec<PublicKey>, Vec<PubkeyHash>), PubkeyParseError> where
Ctx: ScriptContext, [src]
&self
) -> Result<(Vec<PublicKey>, Vec<PubkeyHash>), PubkeyParseError> where
Ctx: ScriptContext,
Returns tuple with two vectors: one for public keys and one for public key hashes present in the script; if any of the keys or hashes has more than a single occurrence it returns all occurrences for each of them
pub fn extract_pubkeys<Ctx>(&self) -> Result<Vec<PublicKey>, PubkeyParseError> where
Ctx: ScriptContext, [src]
Ctx: ScriptContext,
Returns all public keys found in the script; fails on public key hash. If the key present multiple times in the script it returns all occurrences.
pub fn replace_pubkeys<Ctx, Fpk>(
&self,
processor: Fpk
) -> Result<Self, PubkeyParseError> where
Ctx: ScriptContext,
Fpk: Fn(&PublicKey) -> PublicKey, [src]
&self,
processor: Fpk
) -> Result<Self, PubkeyParseError> where
Ctx: ScriptContext,
Fpk: Fn(&PublicKey) -> PublicKey,
Replaces pubkeys using provided matching function; does not fail on public key hashes.
pub fn replace_pubkeys_and_hashes<Ctx, Fpk, Fpkh>(
&self,
key_processor: Fpk,
hash_processor: Fpkh
) -> Result<Self, PubkeyParseError> where
Ctx: ScriptContext,
Fpk: Fn(&PublicKey) -> PublicKey,
Fpkh: Fn(&Hash) -> Hash, [src]
&self,
key_processor: Fpk,
hash_processor: Fpkh
) -> Result<Self, PubkeyParseError> where
Ctx: ScriptContext,
Fpk: Fn(&PublicKey) -> PublicKey,
Fpkh: Fn(&Hash) -> Hash,
Replaces public keys and public key hashes using provided matching functions.
Trait Implementations
impl AsMut<<LockScript as Wrapper>::Inner> for LockScript[src]
impl AsRef<<LockScript as Wrapper>::Inner> for LockScript[src]
impl Borrow<<LockScript as Wrapper>::Inner> for LockScript[src]
impl BorrowMut<<LockScript as Wrapper>::Inner> for LockScript[src]
fn borrow_mut(&mut self) -> &mut Self::Inner[src]
impl Clone for LockScript[src]
fn clone(&self) -> LockScript[src]
pub fn clone_from(&mut self, source: &Self)1.0.0[src]
impl Debug for LockScript[src]
impl Default for LockScript[src]
fn default() -> LockScript[src]
impl Deref for LockScript[src]
type Target = Self::Inner
The resulting type after dereferencing.
fn deref(&self) -> &Self::Target[src]
impl DerefMut for LockScript[src]
impl Display for LockScript[src]
impl Eq for LockScript[src]
impl From<LockScript> for WitnessScript[src]
fn from(lock_script: LockScript) -> Self[src]
impl From<LockScript> for RedeemScript[src]
fn from(lock_script: LockScript) -> Self[src]
impl From<RedeemScript> for LockScript[src]
fn from(redeem_script: RedeemScript) -> Self[src]
impl From<Script> for LockScript[src]
impl From<WitnessScript> for LockScript[src]
fn from(witness_script: WitnessScript) -> Self[src]
impl Hash for LockScript[src]
fn hash<__H: Hasher>(&self, state: &mut __H)[src]
pub fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher, 1.3.0[src]
H: Hasher,
impl LowerHex for LockScript[src]
impl Ord for LockScript[src]
fn cmp(&self, other: &LockScript) -> Ordering[src]
#[must_use]pub fn max(self, other: Self) -> Self1.21.0[src]
#[must_use]pub fn min(self, other: Self) -> Self1.21.0[src]
#[must_use]pub fn clamp(self, min: Self, max: Self) -> Self1.50.0[src]
impl PartialEq<LockScript> for LockScript[src]
fn eq(&self, other: &LockScript) -> bool[src]
fn ne(&self, other: &LockScript) -> bool[src]
impl PartialOrd<LockScript> for LockScript[src]
fn partial_cmp(&self, other: &LockScript) -> Option<Ordering>[src]
#[must_use]pub fn lt(&self, other: &Rhs) -> bool1.0.0[src]
#[must_use]pub fn le(&self, other: &Rhs) -> bool1.0.0[src]
#[must_use]pub fn gt(&self, other: &Rhs) -> bool1.0.0[src]
#[must_use]pub fn ge(&self, other: &Rhs) -> bool1.0.0[src]
impl Strategy for LockScript[src]
impl StructuralEq for LockScript[src]
impl StructuralPartialEq for LockScript[src]
impl ToPubkeyScript for LockScript[src]
fn to_pubkey_script(&self, strategy: Category) -> PubkeyScript[src]
impl ToScripts for LockScript[src]
fn to_sig_script(&self, strategy: Category) -> SigScript[src]
fn to_witness(&self, strategy: Category) -> Option<Witness>[src]
fn to_scripts(&self, strategy: Category) -> ScriptSet[src]
impl UpperHex for LockScript[src]
impl Wrapper for LockScript[src]
type Inner = Script
Inner type wrapped by the current newtype
fn from_inner(inner: Self::Inner) -> Self[src]
fn as_inner(&self) -> &Self::Inner[src]
fn as_inner_mut(&mut self) -> &mut Self::Inner[src]
fn into_inner(self) -> Self::Inner[src]
pub fn to_inner(&self) -> Self::Inner[src]
pub fn copy(&self) -> Self where
Self::Inner: Copy, [src]
Self::Inner: Copy,
Auto Trait Implementations
impl RefUnwindSafe for LockScript
impl Send for LockScript
impl Sync for LockScript
impl Unpin for LockScript
impl UnwindSafe for LockScript
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T[src]
impl<T> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T> ToHex for T where
T: LowerHex,
T: LowerHex,
impl<T> ToOwned for T where
T: Clone, [src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T[src]
pub fn clone_into(&self, target: &mut T)[src]
impl<T> ToString for T where
T: Display + ?Sized, [src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,