Struct dice::Die
[−]
[src]
pub struct Die(_);
A die.
Methods
impl Die
[src]
fn minimum(&self) -> i32
Returns the smallest possible result of rolling this die.
fn maximum(&self) -> i32
Returns the largest possible result of rolling this die.
fn average(&self, reroll: Option<Reroll>) -> Ratio
Returns the average result of rolling this die.
fn results(&self) -> impl Iterator<Item = i32>
Returns all the possible results of rolling this die.
fn probabilities(&self, reroll: Option<Reroll>) -> Vec<(i32, Ratio)>
Returns the probabilities of all the possible results of rolling this die.
impl Die
[src]
fn new(size: u32) -> Die
fn size(&self) -> u32
Returns the size of this die.
fn roll(&self, rng: &mut Rng, reroll: Option<Reroll>) -> DieResult
Rolls this die and returns the result.
Trait Implementations
impl Copy for Die
[src]
impl Clone for Die
[src]
fn clone(&self) -> Die
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more
impl Debug for Die
[src]
impl PartialEq for Die
[src]
fn eq(&self, __arg_0: &Die) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &Die) -> bool
This method tests for !=
.
impl Eq for Die
[src]
impl PartialOrd for Die
[src]
fn partial_cmp(&self, __arg_0: &Die) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
fn lt(&self, __arg_0: &Die) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
fn le(&self, __arg_0: &Die) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
fn gt(&self, __arg_0: &Die) -> bool
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
fn ge(&self, __arg_0: &Die) -> bool
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more
impl Ord for Die
[src]
fn cmp(&self, __arg_0: &Die) -> Ordering
This method returns an Ordering
between self
and other
. Read more