[][src]Struct rollenspielsache::dice::Roll

pub struct Roll { /* fields omitted */ }

A Roll represents a single computation, for instance "2d4+5".

Create with fields:

let new_roll = Roll::new(20, 2, Modifiers::default());

Create by string:

let new_roll = Roll::from_str("2d20-7")?;

Execute:

  let result = new_roll.execute();
  println!("{}", result.total());

Roll::default() will build a "1d6+0" roll.

Implementations

impl Roll[src]

pub fn new(die: usize, repeat: usize, modifiers: Modifiers) -> Self[src]

pub fn get_base(&self) -> usize[src]

pub fn get_repeat(&self) -> usize[src]

pub fn execute(&self) -> RollResult[src]

Trait Implementations

impl Clone for Roll[src]

impl Debug for Roll[src]

impl Default for Roll[src]

impl Display for Roll[src]

impl FromStr for Roll[src]

type Err = Error

The associated error which can be returned from parsing.

impl PartialEq<Roll> for Roll[src]

impl RedisInterface for Roll[src]

impl Serialize for Roll[src]

impl StructuralPartialEq for Roll[src]

Auto Trait Implementations

impl RefUnwindSafe for Roll

impl Send for Roll

impl Sync for Roll

impl Unpin for Roll

impl UnwindSafe for Roll

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,