[][src]Struct caith::RollResult

pub struct RollResult { /* fields omitted */ }

A RollResult contains either a single roll result, or if the roll is repeated, a list of the same roll different results. And a reason if needed.

Implementations

impl RollResult[src]

pub fn new_single(r: SingleRollResult) -> Self[src]

Create a RollResult with only one single roll

pub fn new_repeated(v: Vec<SingleRollResult>, total: Option<i64>) -> Self[src]

Create a RollResult with a repeated roll results

pub fn add_reason(&mut self, reason: String)[src]

Add a comment to the result

pub fn get_reason(&self) -> Option<&String>[src]

Get the comment, if any

pub fn get_result(&self) -> &RollResultType[src]

Return the result

pub fn as_single(&self) -> Option<&SingleRollResult>[src]

If the result is a single roll, it will return it

pub fn as_repeated(&self) -> Option<&RepeatedRollResult>[src]

If the result is a repeated roll, it will return it

Trait Implementations

impl Clone for RollResult[src]

impl Debug for RollResult[src]

impl Display for RollResult[src]

Auto Trait Implementations

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>,