[][src]Enum miniscript::policy::Policy

pub enum Policy<P> {
    Key(P),
    Multi(usizeVec<P>),
    Hash(Hash),
    Time(u32),
    Threshold(usizeVec<Policy<P>>),
    And(Box<Policy<P>>, Box<Policy<P>>),
    Or(Box<Policy<P>>, Box<Policy<P>>),
    AsymmetricOr(Box<Policy<P>>, Box<Policy<P>>),
}

Script descriptor

Variants

Key(P)

A public key which must sign to satisfy the descriptor

Multi(usizeVec<P>)

A set of keys, signatures must be provided for k of them

Hash(Hash)

A SHA256 whose preimage must be provided to satisfy the descriptor

Time(u32)

A locktime restriction

Threshold(usizeVec<Policy<P>>)

A set of descriptors, satisfactions must be provided for k of them

And(Box<Policy<P>>, Box<Policy<P>>)

A list of descriptors, all of which must be satisfied

Or(Box<Policy<P>>, Box<Policy<P>>)

A pair of descriptors, one of which must be satisfied

AsymmetricOr(Box<Policy<P>>, Box<Policy<P>>)

Same as Or, but the second option is assumed to never be taken for costing purposes

Methods

impl<P: Clone + Debug> Policy<P>[src]

pub fn compile(&self) -> Miniscript<P>[src]

Compile the descriptor into an optimized Miniscript representation

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

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

impl<P> Policy<P>[src]

pub fn translate<F, Q, E>(&self, translatefn: &F) -> Result<Policy<Q>, E> where
    F: Fn(&P) -> Result<Q, E>, 
[src]

Convert a policy using abstract keys to one using specific keys

Trait Implementations

impl<P: FromStr> FromTree for Policy<P> where
    P::Err: ToString + Debug
[src]

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

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

impl<P: Clone> Clone for Policy<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 Policy<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

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

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

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

impl<P: FromStr> FromStr for Policy<P> where
    P::Err: ToString + Debug
[src]

type Err = Error

The associated error which can be returned from parsing.

Auto Trait Implementations

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

impl<P> Sync for Policy<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> 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.

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