Struct branchless::core::formatting::Pluralize[][src]

pub struct Pluralize<'a> {
    pub amount: isize,
    pub singular: &'a str,
    pub plural: &'a str,
}

Pluralize a quantity, as appropriate. Example:

let p = Pluralize { amount: 1, singular: "thing", plural: "things"};
assert_eq!(p.to_string(), "1 thing");

let p = Pluralize { amount: 2, singular: "thing", plural: "things"};
assert_eq!(p.to_string(), "2 things");

Fields

amount: isize

The amount of the quantity.

singular: &'a str

The string to render if the amount is singular.

plural: &'a str

The string to render if the amount is plural.uee

Trait Implementations

impl<'a> ToString for Pluralize<'a>[src]

Auto Trait Implementations

impl<'a> RefUnwindSafe for Pluralize<'a>

impl<'a> Send for Pluralize<'a>

impl<'a> Sync for Pluralize<'a>

impl<'a> Unpin for Pluralize<'a>

impl<'a> UnwindSafe for Pluralize<'a>

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> Erased for T

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

impl<T, U> Into<U> for T where
    U: From<T>, 
[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>, 

impl<T> With for T