Struct Dice
Source pub struct Dice {
pub count: u8,
pub sides: u8,
pub modifiers: Vec<Modifier>,
}
Expand description
A set of one or more rollable dice with a specific number of sides, along with a collection of modifiers to apply to
any resulting rolls from them.
Number of sides for each die
Modifiers to automatically apply to rolls from this set of dice
Creates a new set of dice matching this one but without any modifiers.
Creates a new set of dice with a given count and number of sides.
Creates a new dice builder.
Performs copy-assignment from
source
.
Read more
Formats the value using the given formatter.
Read more
Creates the default dice (1d20).
Formats the value using the given formatter.
Read more
The associated error which can be returned from parsing.
Parses a string
s
to return a value of this type.
Read more
Generates a parser for this type that expects end of input. Requires the parse
feature (enabled by default).
Generates a parser for this type that parses up to the end of valid input. Requires the parse
feature
(enabled by default).
Tests for self
and other
values to be equal, and is used by ==
.
Tests for !=
. The default implementation is almost always sufficient,
and should not be overridden without very good reason.
Immutably borrows from an owned value.
Read more
Mutably borrows from an owned value.
Read more
🔬This is a nightly-only experimental API. (clone_to_uninit
)
Performs copy-assignment from
self
to
dest
.
Read more
Checks if this value is equivalent to the given key.
Read more
Returns the argument unchanged.
Calls U::from(self)
.
That is, this conversion is whatever the implementation of
From<T> for U
chooses to do.
The item yielded by the iterator.
An iterator over the items within this container, by reference.
Iterate over the elements of the container.
Check whether an item is contained within this sequence.
Convert an item of the sequence into a
MaybeRef
.
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning.
Read more
Uses borrowed data to replace owned data, usually by cloning.
Read more
Converts the given value to a
String
.
Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.