Skip to main content

Dice

Trait Dice 

Source
pub trait Dice {
    // Required method
    fn roll(&mut self, sides: u16) -> Option<u16>;

    // Provided method
    fn d20(&mut self) -> Option<u8> { ... }
}
Expand description

Source of d20 rolls. The server rolls real dice; clients predicting an outcome use NoDice, so anything needing a roll waits for the server.

Required Methods§

Source

fn roll(&mut self, sides: u16) -> Option<u16>

A roll of a die with sides sides.

Provided Methods§

Source

fn d20(&mut self) -> Option<u8>

A d20 roll.

Implementors§