[][src]Trait critfail::RollExpression

pub trait RollExpression: Sized + FromStr<Err = ParseError> {
    type Outcome: Display + Debug;
    fn roll(&self) -> Self::Outcome;

    fn new(expression: &str) -> Result<Self, ParseError> { ... }
}

Used for structs defining a set of dice that can be rolled.

Associated Types

type Outcome: Display + Debug

The roll result type should implement both Display and Debug. Display should print out a consise result for the roll, and Debug should print out the details (eg the value for each rolled die).

Loading content...

Required methods

fn roll(&self) -> Self::Outcome

Roll the dice and return an outcome.

Loading content...

Provided methods

fn new(expression: &str) -> Result<Self, ParseError>

Create a new roll expression by parsing the given string.

Loading content...

Implementors

impl RollExpression for Roll[src]

type Outcome = RollOutcome

impl RollExpression for Attack[src]

type Outcome = AttackOutcome

impl RollExpression for Check[src]

type Outcome = CheckOutcome

impl RollExpression for Damage[src]

type Outcome = DamageOutcome

Loading content...