pub enum ANFValue {
Show 17 variants
LoadParam {
name: String,
},
LoadProp {
name: String,
},
LoadConst {
value: Value,
},
BinOp {
op: String,
left: String,
right: String,
result_type: Option<String>,
},
UnaryOp {
op: String,
operand: String,
result_type: Option<String>,
},
Call {
func: String,
args: Vec<String>,
},
MethodCall {
object: String,
method: String,
args: Vec<String>,
},
If {
cond: String,
then: Vec<ANFBinding>,
else_branch: Vec<ANFBinding>,
},
Loop {
count: usize,
body: Vec<ANFBinding>,
iter_var: String,
},
Assert {
value: String,
},
UpdateProp {
name: String,
value: String,
},
GetStateScript {},
CheckPreimage {
preimage: String,
},
DeserializeState {
preimage: String,
},
AddOutput {
satoshis: String,
state_values: Vec<String>,
preimage: String,
},
AddRawOutput {
satoshis: String,
script_bytes: String,
},
ArrayLiteral {
elements: Vec<String>,
},
}Expand description
Discriminated union of all ANF value types.
Uses #[serde(tag = "kind")] to match the JSON "kind" discriminator.
Variants§
LoadParam
LoadProp
LoadConst
BinOp
UnaryOp
Call
MethodCall
If
Loop
Assert
UpdateProp
GetStateScript
CheckPreimage
DeserializeState
AddOutput
AddRawOutput
ArrayLiteral
Implementations§
Source§impl ANFValue
impl ANFValue
Sourcepub fn const_value(&self) -> Option<ConstValue>
pub fn const_value(&self) -> Option<ConstValue>
Extract the typed constant from a LoadConst value.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for ANFValue
impl<'de> Deserialize<'de> for ANFValue
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for ANFValue
impl RefUnwindSafe for ANFValue
impl Send for ANFValue
impl Sync for ANFValue
impl Unpin for ANFValue
impl UnsafeUnpin for ANFValue
impl UnwindSafe for ANFValue
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more