[][src]Enum miniscript::miniscript::astelem::AstElem

pub enum AstElem<P> {
    Pk(P),
    PkV(P),
    PkQ(P),
    PkW(P),
    Multi(usizeVec<P>),
    MultiV(usizeVec<P>),
    TimeT(u32),
    TimeV(u32),
    TimeF(u32),
    Time(u32),
    TimeW(u32),
    HashT(Hash),
    HashV(Hash),
    HashW(Hash),
    True(Box<AstElem<P>>),
    Wrap(Box<AstElem<P>>),
    Likely(Box<AstElem<P>>),
    Unlikely(Box<AstElem<P>>),
    AndCat(Box<AstElem<P>>, Box<AstElem<P>>),
    AndBool(Box<AstElem<P>>, Box<AstElem<P>>),
    AndCasc(Box<AstElem<P>>, Box<AstElem<P>>),
    OrBool(Box<AstElem<P>>, Box<AstElem<P>>),
    OrCasc(Box<AstElem<P>>, Box<AstElem<P>>),
    OrCont(Box<AstElem<P>>, Box<AstElem<P>>),
    OrKey(Box<AstElem<P>>, Box<AstElem<P>>),
    OrKeyV(Box<AstElem<P>>, Box<AstElem<P>>),
    OrIf(Box<AstElem<P>>, Box<AstElem<P>>),
    OrIfV(Box<AstElem<P>>, Box<AstElem<P>>),
    OrNotif(Box<AstElem<P>>, Box<AstElem<P>>),
    Thresh(usizeVec<AstElem<P>>),
    ThreshV(usizeVec<AstElem<P>>),
}

All AST elements

Variants

Pk(P)

<key> CHECKSIG

PkV(P)

<key> CHECKSIGVERIFY

PkQ(P)

<key>

PkW(P)

SWAP <key> CHECKSIG

Multi(usizeVec<P>)

<k> <keys...> <n> CHECKMULTISIG

MultiV(usizeVec<P>)

<k> <keys...> <n> CHECKMULTISIGVERIFY

TimeT(u32)

<n> CHECKSEQUENCEVERIFY

TimeV(u32)

<n> CHECKSEQUENCEVERIFY DROP

TimeF(u32)

<n> CHECKSEQUENCEVERIFY 0NOTEQUAL

Time(u32)

DUP IF <n> CHECKSEQUENCEVERIFY DROP ENDIF

TimeW(u32)

SWAP DUP IF <n> CHECKSEQUENCEVERIFY DROP ENDIF

HashT(Hash)

SIZE 32 EQUALVERIFY SHA256 <hash> EQUAL

HashV(Hash)

SIZE 32 EQUALVERIFY SHA256 <hash> EQUALVERIFY

HashW(Hash)

SWAP SIZE 0NOTEQUAL IF SIZE 32 EQUALVERIFY SHA256 <hash> EQUALVERIFY 1 ENDIF

True(Box<AstElem<P>>)

<V> 1

Wrap(Box<AstElem<P>>)

TAS <E> FAS

Likely(Box<AstElem<P>>)

NOTIF <F> ELSE 0 ENDIF

Unlikely(Box<AstElem<P>>)

IF <F> ELSE 0 ENDIF

AndCat(Box<AstElem<P>>, Box<AstElem<P>>)

<V> <T/V/F/Q>

AndBool(Box<AstElem<P>>, Box<AstElem<P>>)

<E> <W> BOOLAND

AndCasc(Box<AstElem<P>>, Box<AstElem<P>>)

<E> NOTIF 0 ELSE <F> ENDIF

OrBool(Box<AstElem<P>>, Box<AstElem<P>>)

<E> <W> BoolOr

OrCasc(Box<AstElem<P>>, Box<AstElem<P>>)

<E> IFDUP NOTIF <T/E> ENDIF

OrCont(Box<AstElem<P>>, Box<AstElem<P>>)

<E> NOTIF <V> ENDIF

OrKey(Box<AstElem<P>>, Box<AstElem<P>>)

IF <Q> ELSE <Q> ENDIF CHECKSIG

OrKeyV(Box<AstElem<P>>, Box<AstElem<P>>)

IF <Q> ELSE <Q> ENDIF CHECKSIGVERIFY

OrIf(Box<AstElem<P>>, Box<AstElem<P>>)

IF <sub1> ELSE <sub2> ENDIF for many choices of sub1 and sub2

OrIfV(Box<AstElem<P>>, Box<AstElem<P>>)

IF <T> ELSE <T> ENDIF VERIFY

OrNotif(Box<AstElem<P>>, Box<AstElem<P>>)

NOTIF <F> ELSE <E> ENDIF

Thresh(usizeVec<AstElem<P>>)

<E> (<W> ADD)* <n> EQUAL

ThreshV(usizeVec<AstElem<P>>)

<E> (<W> ADD)* <n> EQUALVERIFY

Methods

impl<P> AstElem<P>[src]

pub fn is_e(&self) -> bool[src]

Does the element satisfy the "expression" calling convention?

pub fn is_q(&self) -> bool[src]

Does the element satisfy the "queue" calling convention?

pub fn is_w(&self) -> bool[src]

Does the element satisfy the "wrapped" calling convention?

pub fn is_f(&self) -> bool[src]

Does the element satisfy the "forced" calling convention?

pub fn is_v(&self) -> bool[src]

Does the element satisfy the "verify" calling convention?

pub fn is_t(&self) -> bool[src]

Does the element satisfy the "toplevel" calling convention?

pub fn translate<Func, Q, Error>(
    &self,
    translatefn: &mut Func
) -> Result<AstElem<Q>, Error> where
    Func: FnMut(&P) -> Result<Q, Error>, 
[src]

Convert an AST element with one public key type to one of another public key type

impl<P: Clone> AstElem<P>[src]

pub fn abstract_policy(&self) -> AbstractPolicy<P>[src]

Abstract the script into an "abstract policy" which can be filtered and analyzed

pub fn public_keys(&self) -> Vec<P>[src]

Return a list of all public keys which might contribute to satisfaction of the scriptpubkey

impl<P: ToPublicKey> AstElem<P>[src]

pub fn encode(&self, builder: Builder) -> Builder[src]

Encode the element as a fragment of Bitcoin Script. The inverse function, from Script to an AST element, is implemented in the parse module.

Trait Implementations

impl<P: ToPublicKey> Satisfiable<P> for AstElem<P>[src]

impl<P: ToPublicKey> Dissatisfiable<P> for AstElem<P>[src]

impl<P: FromStr> FromTree for AstElem<P> where
    <P as FromStr>::Err: ToString
[src]

impl<P: PartialOrd> PartialOrd<AstElem<P>> for AstElem<P>[src]

impl<P: PartialEq> PartialEq<AstElem<P>> for AstElem<P>[src]

impl<P> From<AstElem<P>> for Miniscript<P>[src]

impl<P: Clone> Clone for AstElem<P>[src]

fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

impl<P: Ord> Ord for AstElem<P>[src]

fn max(self, other: Self) -> Self
1.21.0
[src]

Compares and returns the maximum of two values. Read more

fn min(self, other: Self) -> Self
1.21.0
[src]

Compares and returns the minimum of two values. Read more

fn clamp(self, min: Self, max: Self) -> Self[src]

🔬 This is a nightly-only experimental API. (clamp)

Returns max if self is greater than max, and min if self is less than min. Otherwise this will return self. Panics if min > max. Read more

impl<P: Eq> Eq for AstElem<P>[src]

impl<P: Display> Display for AstElem<P>[src]

impl<P: Debug> Debug for AstElem<P>[src]

Auto Trait Implementations

impl<P> Send for AstElem<P> where
    P: Send

impl<P> Sync for AstElem<P> where
    P: Sync

Blanket Implementations

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T> From for T[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.