#[non_exhaustive]pub struct PluralSlot {
pub group: Box<str>,
pub kind: PluralKind,
pub category: Option<Box<str>>,
pub index: Option<u8>,
pub arg: Option<Box<str>>,
pub parent: Option<Box<str>>,
pub added: bool,
}Expand description
One form of a plural group. Build it with PluralSlot::new and the with_* methods. Optional fields are
left out of the JSON when unset, added when false.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.group: Box<str>Shared by every form of one message (one plural or select argument), unique in the document.
kind: PluralKindCardinal, ordinal or select.
category: Option<Box<str>>The CLDR category (one, few), an exact value (=0) or a select key (female). gettext has none: its
order is not CLDR order (see index).
index: Option<u8>The gettext msgstr[N] index.
arg: Option<Box<str>>The ICU argument name (count), when known.
parent: Option<Box<str>>The enclosing group, for a plural inside a select (or any nesting).
added: boolA target category the source does not have, added at extract so it can be translated (and a unit inside
such a form). Untranslated, it writes what the source other form gives.
Implementations§
Source§impl PluralSlot
impl PluralSlot
Sourcepub fn new(group: impl Into<Box<str>>, kind: PluralKind) -> PluralSlot
pub fn new(group: impl Into<Box<str>>, kind: PluralKind) -> PluralSlot
A form of group of this kind, with no category, index, argument or parent.
Sourcepub fn with_category(self, category: impl Into<Box<str>>) -> PluralSlot
pub fn with_category(self, category: impl Into<Box<str>>) -> PluralSlot
Sets the category.
Sourcepub fn with_index(self, index: u8) -> PluralSlot
pub fn with_index(self, index: u8) -> PluralSlot
Sets the gettext index.
Sourcepub fn with_parent(self, parent: impl Into<Box<str>>) -> PluralSlot
pub fn with_parent(self, parent: impl Into<Box<str>>) -> PluralSlot
Sets the enclosing group.
Sourcepub fn with_added(self, added: bool) -> PluralSlot
pub fn with_added(self, added: bool) -> PluralSlot
Marks the form as added for the target language (or not).
Sourcepub fn kind(&self) -> PluralKind
pub fn kind(&self) -> PluralKind
The kind.