pub trait Roller {
// Required method
fn roll_die(&mut self, sides: u8) -> DieRoll;
// Provided method
fn roll<'d, 'r>(
&mut self,
dice: &'d Dice,
apply_mods: bool
) -> Result<Rolled<'r>, Error>
where Self: Sized,
'd: 'r { ... }
}
Expand description
Rolls dice - what else is there to say?
Required Methods§
Provided Methods§
sourcefn roll<'d, 'r>(
&mut self,
dice: &'d Dice,
apply_mods: bool
) -> Result<Rolled<'r>, Error>where
Self: Sized,
'd: 'r,
fn roll<'d, 'r>(
&mut self,
dice: &'d Dice,
apply_mods: bool
) -> Result<Rolled<'r>, Error>where
Self: Sized,
'd: 'r,
Rolls a set of dice and optionally applies all of its modifiers to the rolls.
§Errors
If any errors are encountered while applying the dice’s modifiers, an error variant is returned.