pub struct Catalog { /* private fields */ }Expand description
A crate’s generated lookup tables, as used by t! and t_in!.
fluent-zero-build generates one as the CATALOG static at the root of
each crate that includes its output. Besides each locale under its own key,
a catalog answers for the language-level keys that end a fallback chain
(ru when only ru-RU/ exists, zh-TW when only zh-Hant/ exists),
resolved by fluent-zero-build against this crate’s own locales. Each
entry carries both the static cache and the bundle, so a lookup costs one
map probe per candidate key.
Implementations§
Source§impl Catalog
impl Catalog
Sourcepub const fn fallback(&self) -> &'static str
pub const fn fallback(&self) -> &'static str
The locale tried when the language’s own chain has no message.
Sourcepub fn locales(&self) -> impl ExactSizeIterator<Item = &'static str>
pub fn locales(&self) -> impl ExactSizeIterator<Item = &'static str>
Every locale key this catalog answers for, including negotiation
aliases such as pt for pt-PT, in no particular order.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Catalog
impl !UnwindSafe for Catalog
impl Freeze for Catalog
impl Send for Catalog
impl Sync for Catalog
impl Unpin for Catalog
impl UnsafeUnpin for Catalog
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more