pub enum Expression {
Binary(Binary, Box<Expression>, Box<Expression>),
Constant(u32),
Die(Die, Option<Reroll>),
Dice(Dice, Option<Reroll>, Fold),
}Expand description
A dice rolling expression.
Variants§
Binary(Binary, Box<Expression>, Box<Expression>)
A binary expression.
Constant(u32)
A constant expression.
Die(Die, Option<Reroll>)
A die expression.
Dice(Dice, Option<Reroll>, Fold)
A dice expression.
Implementations§
Source§impl Expression
impl Expression
Sourcepub fn minimum(&self) -> Option<i32>
pub fn minimum(&self) -> Option<i32>
Returns the smallest possible result of rolling this dice rolling expression.
Sourcepub fn maximum(&self) -> Option<i32>
pub fn maximum(&self) -> Option<i32>
Returns the largest possible result of rolling this dice rolling expression.
Sourcepub fn average(&self) -> Option<Ratio>
pub fn average(&self) -> Option<Ratio>
Returns the average result of rolling this dice rolling expression.
Trait Implementations§
Source§impl Clone for Expression
impl Clone for Expression
Source§fn clone(&self) -> Expression
fn clone(&self) -> Expression
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 Expression
impl Debug for Expression
impl Eq for Expression
Source§impl PartialEq for Expression
impl PartialEq for Expression
Source§fn eq(&self, other: &Expression) -> bool
fn eq(&self, other: &Expression) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for Expression
Auto Trait Implementations§
impl Freeze for Expression
impl RefUnwindSafe for Expression
impl Send for Expression
impl Sync for Expression
impl Unpin for Expression
impl UnsafeUnpin for Expression
impl UnwindSafe for Expression
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