Struct plurr::Plurr [−][src]
Implementations
impl<'a> Plurr<'a>
[src]
pub fn new() -> Self
[src]
pub fn locale(&mut self, locale_code: &'a str) -> &mut Self
[src]
Sets the locale for Plurr. If this is not called or an incompatible
locale_code
is provided, it defaults to English.
pub fn auto_plurals(&mut self, auto_plurals: bool) -> &mut Self
[src]
Toggles the auto-plural behavior.
- With auto-plurals, Plurr will automatically select the plural form for the current locale.
- Without auto-plurals, you will need to manually provide an
N_PLURAL
parameter before callingformat()
.
pub fn strict(&mut self, strict: bool) -> &mut Self
[src]
Toggles strict mode. In strict mode, errors are not skipped.
pub fn param<T: ToString>(&mut self, key: &str, value: T) -> &mut Self
[src]
Stores a parameter value. Parameters must be fed before calling
format()
.
pub fn format(&mut self, value: &str) -> Result<String, PlurrError>
[src]
Trait Implementations
Auto Trait Implementations
impl<'a> RefUnwindSafe for Plurr<'a>
[src]
impl<'a> Send for Plurr<'a>
[src]
impl<'a> Sync for Plurr<'a>
[src]
impl<'a> Unpin for Plurr<'a>
[src]
impl<'a> UnwindSafe for Plurr<'a>
[src]
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,
pub 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, 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.
pub 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>,