[−][src]Struct rollenspielsache::dice::Roll
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.
fn from_str(s: &str) -> Result<Self, Self::Err>
[src]
impl PartialEq<Roll> for Roll
[src]
impl RedisInterface for Roll
[src]
fn to_redis_hash(&self) -> RedisHash
[src]
impl Serialize for Roll
[src]
fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer,
[src]
__S: Serializer,
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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,