pub struct Max;
Expand description
Generates rolls that always have their max value.
§Examples
use tyche::dice::{roller::{Max as MaxRoller, Roller}, Dice};
let mut roller = MaxRoller;
let dice = Dice::new(4, 6);
let rolled = roller.roll(&dice, true)?;
assert!(rolled.rolls.iter().all(|roll| roll.val == 6));
let dice = Dice::new(2, 20);
let rolled = roller.roll(&dice, true)?;
assert!(rolled.rolls.iter().all(|roll| roll.val == 20));
Trait Implementations§
Auto Trait Implementations§
impl RefUnwindSafe for Max
impl Send for Max
impl Sync for Max
impl Unpin for Max
impl UnwindSafe for Max
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
§impl<'p, T> Seq<'p, T> for Twhere
T: Clone,
impl<'p, T> Seq<'p, T> for Twhere
T: Clone,
§type Iter<'a> = Once<&'a T>
where
T: 'a
type Iter<'a> = Once<&'a T> where T: 'a
An iterator over the items within this container, by reference.
§fn contains(&self, val: &T) -> boolwhere
T: PartialEq,
fn contains(&self, val: &T) -> boolwhere
T: PartialEq,
Check whether an item is contained within this sequence.
§fn to_maybe_ref<'b>(item: <T as Seq<'p, T>>::Item<'b>) -> Maybe<T, &'p T>where
'p: 'b,
fn to_maybe_ref<'b>(item: <T as Seq<'p, T>>::Item<'b>) -> Maybe<T, &'p T>where
'p: 'b,
Convert an item of the sequence into a [
MaybeRef
].