Enum elements_miniscript::extensions::IdxExpr
source · pub enum IdxExpr {
Const(usize),
CurrIdx,
Add(Box<IdxExpr>, Box<IdxExpr>),
Sub(Box<IdxExpr>, Box<IdxExpr>),
Mul(Box<IdxExpr>, Box<IdxExpr>),
Div(Box<IdxExpr>, Box<IdxExpr>),
}Expand description
Enum representing operations with input/output indexes. Pushes a single CScriptNum on stack top. This is used to represent the index of the input or output.
Variants§
Const(usize)
A constant
<i> as CScriptNum
CurrIdx
Current Input index
Add(Box<IdxExpr>, Box<IdxExpr>)
Add two IdxExpr
[X] [Y] ADD
Sub(Box<IdxExpr>, Box<IdxExpr>)
Subtract two IdxExpr
[X] [Y] SUB
Mul(Box<IdxExpr>, Box<IdxExpr>)
Multiply two IdxExpr
[X] SCIPTNUMTOLE64 [Y] SCIPTNUMTOLE64 MUL64 <1> EQUALVERIFY LE64TOSCIPTNUM
Div(Box<IdxExpr>, Box<IdxExpr>)
Divide two IdxExpr (integer division)
[X] SCIPTNUMTOLE64 [Y] SCIPTNUMTOLE64 DIV64 <1> EQUALVERIFY NIP LE64TOSCIPTNUM
Implementations§
Trait Implementations§
source§impl Ord for IdxExpr
impl Ord for IdxExpr
source§impl PartialEq for IdxExpr
impl PartialEq for IdxExpr
source§impl PartialOrd for IdxExpr
impl PartialOrd for IdxExpr
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self and other) and is used by the <=
operator. Read moreimpl Eq for IdxExpr
impl StructuralPartialEq for IdxExpr
Auto Trait Implementations§
impl RefUnwindSafe for IdxExpr
impl Send for IdxExpr
impl Sync for IdxExpr
impl Unpin for IdxExpr
impl UnwindSafe for IdxExpr
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