pub struct DieBuilder { /* private fields */ }
Expand description
Die Builder
This class is used to build a new die. The user has the option of setting the sides and RNG the die will use.
Implementations§
Source§impl DieBuilder
impl DieBuilder
Sourcepub fn new() -> DieBuilder
pub fn new() -> DieBuilder
Creates a new DieBuilder, which defaults to a 6 sided die using a standard RNG.
Sourcepub fn sides(self, sides: u8) -> DieBuilder
pub fn sides(self, sides: u8) -> DieBuilder
Set the desired number of sides for the Die. Default value is used if 0 is passed.
Sourcepub fn rng(self, rng: Box<dyn DieRng>) -> DieBuilder
pub fn rng(self, rng: Box<dyn DieRng>) -> DieBuilder
Set the desired RNG for the Die.
Auto Trait Implementations§
impl Freeze for DieBuilder
impl !RefUnwindSafe for DieBuilder
impl !Send for DieBuilder
impl !Sync for DieBuilder
impl Unpin for DieBuilder
impl !UnwindSafe for DieBuilder
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