Skip to main content

PluralResolver

Trait PluralResolver 

Source
pub trait PluralResolver {
    // Required methods
    fn cardinal(&self, n: i64, locale_override: Option<&str>) -> PluralCategory;
    fn ordinal(&self, n: i64) -> PluralCategory;
}
Expand description

Trait for resolving plural categories at runtime.

Implementors provide locale-aware plural resolution. The brink-intl crate ships a batteries-included implementation backed by ICU4X baked data.

Required Methods§

Source

fn cardinal(&self, n: i64, locale_override: Option<&str>) -> PluralCategory

Resolve the cardinal plural category for the given integer.

locale_override allows overriding the resolver’s default locale.

Source

fn ordinal(&self, n: i64) -> PluralCategory

Resolve the ordinal plural category for the given integer.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§