pub struct DiceRollWithOp {
pub dice_roll: DiceRoll,
pub operation: Operation,
}
Expand description
A struct that contains the dice roll, plus whether the roll is negative or positive.
Fields§
§dice_roll: DiceRoll
The DiceRoll
operation: Operation
How the roll should be applied. Either it should have a positive impact on the total sum, or a negative one
Implementations§
Source§impl DiceRollWithOp
A convinience method for creating a DiceRollWithOp
.
impl DiceRollWithOp
A convinience method for creating a DiceRollWithOp
.
§Examples
This represents a d6 with no modifier
use dice_command_parser::{dice_roll::{DiceRoll, Operation}, dice_roll_with_op::DiceRollWithOp};
let dice_roll = DiceRollWithOp::new(DiceRoll::new_regular_roll(6, None, 1), Operation::Addition);
Trait Implementations§
Source§impl Clone for DiceRollWithOp
impl Clone for DiceRollWithOp
Source§fn clone(&self) -> DiceRollWithOp
fn clone(&self) -> DiceRollWithOp
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 Debug for DiceRollWithOp
impl Debug for DiceRollWithOp
Source§impl PartialEq for DiceRollWithOp
impl PartialEq for DiceRollWithOp
impl StructuralPartialEq for DiceRollWithOp
Auto Trait Implementations§
impl Freeze for DiceRollWithOp
impl RefUnwindSafe for DiceRollWithOp
impl Send for DiceRollWithOp
impl Sync for DiceRollWithOp
impl Unpin for DiceRollWithOp
impl UnwindSafe for DiceRollWithOp
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