[−][src]Struct mice::FormatOptions
Formatting options for dice expressions. Necessary for stability of user facing output, which is this library's primary concern.
Default formatting MAY change between patch releases. New public options MUST cause a minor version increment. Changes to the behavior of an existing public option MUST cause a minor version increment.
To get back the old formatting scheme:
let format = MiceFormat::new() .total_left() .term_commas() .term_list_parens() .concise(); println!("{}", roll("2d6 + 3")?.format(format));
Methods
impl FormatOptions
[src]
pub fn new() -> FormatOptions
[src]
Obtain a new FormatOptions
object.
pub fn total_right(self) -> Self
[src]
The total of an expression will appear on the
right hand side of it, = total
.
pub fn total_left(self) -> Self
[src]
The total of an expression will appear on the
left hand side of it, total =
.
pub fn no_total(self) -> Self
[src]
The total of an expression will not appear. This is the current default.
pub fn concise(self) -> Self
[src]
Dice term representations will be (Dice → Total)
.
pub fn verbose(self) -> Self
[src]
Dice term representations will be (Dice → Die1 + Die2 + ...)
.
This is the current default.
pub fn term_commas(self) -> Self
[src]
Separate term results with commas. Term1, Term2, ...
pub fn term_pluses(self) -> Self
[src]
Separate term results with plus signs. Term1 + Term2 + ...
This is the current default.
pub fn dice_parens(self) -> Self
[src]
Wrap each dice term result in parentheses. This is the current default.
pub fn no_term_parens(self) -> Self
[src]
Don't wrap each dice term result in parentheses.
pub fn term_list_parens(self) -> Self
[src]
Wrap entire list of terms in parentheses.
pub fn no_term_list_parens(self) -> Self
[src]
Don't wrap entire list of terms in parentheses. This is the current default.
Trait Implementations
impl Default for FormatOptions
[src]
impl Clone for FormatOptions
[src]
fn clone(&self) -> FormatOptions
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Copy for FormatOptions
[src]
impl Debug for FormatOptions
[src]
Auto Trait Implementations
impl Send for FormatOptions
impl Unpin for FormatOptions
impl Sync for FormatOptions
impl UnwindSafe for FormatOptions
impl RefUnwindSafe for FormatOptions
Blanket Implementations
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, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
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<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,