#[non_exhaustive]pub enum Language {
English,
Portuguese,
}Expand description
Languages supported by the internationalization system.
Single source of truth for product locales in this binary. Do not use
bool / raw String / integers for language in APIs.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
English
Neutral English (en) — default / agent-stable technical baseline.
Portuguese
Brazilian Portuguese (pt-BR) — mandatory MVP pair with en.
Implementations§
Source§impl Language
impl Language
Sourcepub const AVAILABLE: &'static [Language]
pub const AVAILABLE: &'static [Language]
Locales compiled into the default binary (MVP: en, pt-BR only).
Sourcepub const fn bcp47(self) -> &'static str
pub const fn bcp47(self) -> &'static str
Canonical BCP47 tag for this product locale.
English is neutral en (not en-US alone). Portuguese is always pt-BR.
Sourcepub fn language_identifier(self) -> LanguageIdentifier
pub fn language_identifier(self) -> LanguageIdentifier
Structured BCP47 identifier (unic-langid).
Built-in tags are compile-time constants (en, pt-BR). On parse
failure (should never happen), falls back to the default undetermined
identifier — no panic on product paths (G-SEC-07).
Sourcepub const fn direction(self) -> TextDirection
pub const fn direction(self) -> TextDirection
Writing direction for this locale.
Sourcepub fn from_langid(id: &LanguageIdentifier) -> Option<Language>
pub fn from_langid(id: &LanguageIdentifier) -> Option<Language>
Maps a negotiated LanguageIdentifier to a product Language.
Matches primary language subtag: en* → English, pt* → Portuguese.
Region-specific product choice for Portuguese is always pt-BR in MVP
(no pt-PT variant compiled without a feature).
Trait Implementations§
impl Copy for Language
impl Eq for Language
impl StructuralPartialEq for Language
Auto Trait Implementations§
impl Freeze for Language
impl RefUnwindSafe for Language
impl Send for Language
impl Sync for Language
impl Unpin for Language
impl UnsafeUnpin for Language
impl UnwindSafe for Language
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.