pub struct EvaluationState<'inst> {
pub result: Option<i32>,
/* private fields */
}Expand description
The complete machine state of a histogram builder during execution. Each state serves as a continuation of the machine, and may be used to resume execution. The machine is suspended after every range or die roll, which only occur inside RollRange, RollStandardDice, and RollCustomDice instructions.
Fields§
§result: Option<i32>The final result of the dice expression, if it has been computed.
Trait Implementations§
Source§impl<'inst> Clone for EvaluationState<'inst>
impl<'inst> Clone for EvaluationState<'inst>
Source§fn clone(&self) -> EvaluationState<'inst>
fn clone(&self) -> EvaluationState<'inst>
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<'inst> Debug for EvaluationState<'inst>
impl<'inst> Debug for EvaluationState<'inst>
Source§impl Display for EvaluationState<'_>
impl Display for EvaluationState<'_>
Source§impl InstructionVisitor<()> for EvaluationState<'_>
impl InstructionVisitor<()> for EvaluationState<'_>
Source§fn visit_roll_range(&mut self, inst: &RollRange) -> Result<(), ()>
fn visit_roll_range(&mut self, inst: &RollRange) -> Result<(), ()>
Visit a range roll instruction. Read more
Source§fn visit_roll_standard_dice(
&mut self,
inst: &RollStandardDice,
) -> Result<(), ()>
fn visit_roll_standard_dice( &mut self, inst: &RollStandardDice, ) -> Result<(), ()>
Visit a standard dice roll instruction. Read more
Source§fn visit_roll_custom_dice(&mut self, inst: &RollCustomDice) -> Result<(), ()>
fn visit_roll_custom_dice(&mut self, inst: &RollCustomDice) -> Result<(), ()>
Visit a custom dice roll instruction. Read more
Source§fn visit_drop_lowest(&mut self, inst: &DropLowest) -> Result<(), ()>
fn visit_drop_lowest(&mut self, inst: &DropLowest) -> Result<(), ()>
Visit a drop lowest instruction. Read more
Source§fn visit_drop_highest(&mut self, inst: &DropHighest) -> Result<(), ()>
fn visit_drop_highest(&mut self, inst: &DropHighest) -> Result<(), ()>
Visit a drop highest instruction. Read more
Source§fn visit_sum_rolling_record(
&mut self,
inst: &SumRollingRecord,
) -> Result<(), ()>
fn visit_sum_rolling_record( &mut self, inst: &SumRollingRecord, ) -> Result<(), ()>
Visit a sum rolling record instruction. Read more
Source§fn visit_add(&mut self, inst: &Add) -> Result<(), ()>
fn visit_add(&mut self, inst: &Add) -> Result<(), ()>
Visit an addition instruction. Read more
Source§fn visit_sub(&mut self, inst: &Sub) -> Result<(), ()>
fn visit_sub(&mut self, inst: &Sub) -> Result<(), ()>
Visit a subtraction instruction. Read more
Source§fn visit_mul(&mut self, inst: &Mul) -> Result<(), ()>
fn visit_mul(&mut self, inst: &Mul) -> Result<(), ()>
Visit a multiplication instruction. Read more
Auto Trait Implementations§
impl<'inst> Freeze for EvaluationState<'inst>
impl<'inst> RefUnwindSafe for EvaluationState<'inst>
impl<'inst> Send for EvaluationState<'inst>
impl<'inst> Sync for EvaluationState<'inst>
impl<'inst> Unpin for EvaluationState<'inst>
impl<'inst> UnwindSafe for EvaluationState<'inst>
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> 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