pub enum Element<'txin> {
Satisfied,
Dissatisfied,
Push(&'txin [u8]),
}
Expand description
Definition of Stack Element of the Stack used for interpretation of Miniscript.
All stack elements with vec![]
go to Element::Dissatisfied
and vec![1]
are marked to
Element::Satisfied
. Others are directly pushed as witness.
Variants§
Satisfied
Result of a satisfied Miniscript fragment
Translated from vec![1]
from input stack
Dissatisfied
Result of a dissatisfied Miniscript fragment
Translated from vec![]
from input stack
Push(&'txin [u8])
Input from the witness stack
Implementations§
Source§impl<'txin> Element<'txin>
impl<'txin> Element<'txin>
Sourcepub fn from_instruction(
ins: Result<Instruction<'txin>, Error>,
) -> Result<Self, Error>
pub fn from_instruction( ins: Result<Instruction<'txin>, Error>, ) -> Result<Self, Error>
Converts a Bitcoin script::Instruction
to a stack element
Supports OP_1
but no other numbers since these are not used by Miniscript
Trait Implementations§
Source§impl<'txin> Ord for Element<'txin>
impl<'txin> Ord for Element<'txin>
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<'txin> PartialOrd for Element<'txin>
impl<'txin> PartialOrd for Element<'txin>
impl<'txin> Copy for Element<'txin>
impl<'txin> Eq for Element<'txin>
impl<'txin> StructuralPartialEq for Element<'txin>
Auto Trait Implementations§
impl<'txin> Freeze for Element<'txin>
impl<'txin> RefUnwindSafe for Element<'txin>
impl<'txin> Send for Element<'txin>
impl<'txin> Sync for Element<'txin>
impl<'txin> Unpin for Element<'txin>
impl<'txin> UnwindSafe for Element<'txin>
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