pub struct EvalAwi { /* private fields */ }
Expand description
When created from a type implementing AsRef<dag::Bits>
, it can later be
used to evaluate its dynamic value.
This will keep the source tree alive in case of pruning.
§Custom Drop
Upon being dropped, this will remove special references being kept by the
current Epoch
.
Implementations§
Source§impl EvalAwi
impl EvalAwi
pub fn from_bool(x: bool) -> Self
pub fn from_u8(x: u8) -> Self
pub fn from_i8(x: i8) -> Self
pub fn from_u16(x: u16) -> Self
pub fn from_i16(x: i16) -> Self
pub fn from_u32(x: u32) -> Self
pub fn from_i32(x: i32) -> Self
pub fn from_u64(x: u64) -> Self
pub fn from_i64(x: i64) -> Self
pub fn from_u128(x: u128) -> Self
pub fn from_i128(x: i128) -> Self
pub fn from_usize(x: usize) -> Self
pub fn from_isize(x: isize) -> Self
Sourcepub fn eval_bool(&self) -> Result<bool, Error>
pub fn eval_bool(&self) -> Result<bool, Error>
The same as EvalAwi::eval, except that it returns a primitive and returns an error if the bitwidth of the evaluation does not match the bitwidth of the primitive
Sourcepub fn eval_u8(&self) -> Result<u8, Error>
pub fn eval_u8(&self) -> Result<u8, Error>
The same as EvalAwi::eval, except that it returns a primitive and returns an error if the bitwidth of the evaluation does not match the bitwidth of the primitive
Sourcepub fn eval_i8(&self) -> Result<i8, Error>
pub fn eval_i8(&self) -> Result<i8, Error>
The same as EvalAwi::eval, except that it returns a primitive and returns an error if the bitwidth of the evaluation does not match the bitwidth of the primitive
Sourcepub fn eval_u16(&self) -> Result<u16, Error>
pub fn eval_u16(&self) -> Result<u16, Error>
The same as EvalAwi::eval, except that it returns a primitive and returns an error if the bitwidth of the evaluation does not match the bitwidth of the primitive
Sourcepub fn eval_i16(&self) -> Result<i16, Error>
pub fn eval_i16(&self) -> Result<i16, Error>
The same as EvalAwi::eval, except that it returns a primitive and returns an error if the bitwidth of the evaluation does not match the bitwidth of the primitive
Sourcepub fn eval_u32(&self) -> Result<u32, Error>
pub fn eval_u32(&self) -> Result<u32, Error>
The same as EvalAwi::eval, except that it returns a primitive and returns an error if the bitwidth of the evaluation does not match the bitwidth of the primitive
Sourcepub fn eval_i32(&self) -> Result<i32, Error>
pub fn eval_i32(&self) -> Result<i32, Error>
The same as EvalAwi::eval, except that it returns a primitive and returns an error if the bitwidth of the evaluation does not match the bitwidth of the primitive
Sourcepub fn eval_u64(&self) -> Result<u64, Error>
pub fn eval_u64(&self) -> Result<u64, Error>
The same as EvalAwi::eval, except that it returns a primitive and returns an error if the bitwidth of the evaluation does not match the bitwidth of the primitive
Sourcepub fn eval_i64(&self) -> Result<i64, Error>
pub fn eval_i64(&self) -> Result<i64, Error>
The same as EvalAwi::eval, except that it returns a primitive and returns an error if the bitwidth of the evaluation does not match the bitwidth of the primitive
Sourcepub fn eval_u128(&self) -> Result<u128, Error>
pub fn eval_u128(&self) -> Result<u128, Error>
The same as EvalAwi::eval, except that it returns a primitive and returns an error if the bitwidth of the evaluation does not match the bitwidth of the primitive
Sourcepub fn eval_i128(&self) -> Result<i128, Error>
pub fn eval_i128(&self) -> Result<i128, Error>
The same as EvalAwi::eval, except that it returns a primitive and returns an error if the bitwidth of the evaluation does not match the bitwidth of the primitive
Sourcepub fn eval_usize(&self) -> Result<usize, Error>
pub fn eval_usize(&self) -> Result<usize, Error>
The same as EvalAwi::eval, except that it returns a primitive and returns an error if the bitwidth of the evaluation does not match the bitwidth of the primitive
Sourcepub fn eval_isize(&self) -> Result<isize, Error>
pub fn eval_isize(&self) -> Result<isize, Error>
The same as EvalAwi::eval, except that it returns a primitive and returns an error if the bitwidth of the evaluation does not match the bitwidth of the primitive
Sourcepub fn from_state(p_state: PState) -> Self
pub fn from_state(p_state: PState) -> Self
pub fn p_external(&self) -> PExternal
pub fn nzbw(&self) -> NonZeroUsize
pub fn bw(&self) -> usize
Sourcepub fn try_clone(&self) -> Result<Self, Error>
pub fn try_clone(&self) -> Result<Self, Error>
Clones self
, returning a perfectly equivalent Eval
that will have
the same eval
effects. Returns an error if the active Epoch
is not
correct.
Sourcepub fn eval(&self) -> Result<Awi, Error>
pub fn eval(&self) -> Result<Awi, Error>
Evaluates the value that self
would evaluate to given the current
state of any LazyAwi
s. Depending on the conditions of internal LUTs,
it may be possible to evaluate to a known value even if some inputs are
opaque
, but in general this will return an error that a bit could not
be evaluated to a known value, if any upstream inputs are opaque
.
Sourcepub fn eval_is_all_unknown(&self) -> Result<bool, Error>
pub fn eval_is_all_unknown(&self) -> Result<bool, Error>
Like EvalAwi::eval
, except it returns if the values are all unknowns
Sourcepub fn set_debug_name<S: AsRef<str>>(&self, debug_name: S) -> Result<(), Error>
pub fn set_debug_name<S: AsRef<str>>(&self, debug_name: S) -> Result<(), Error>
Sets a debug name for self
that is used in debug reporting and
rendering