pub struct Locale { /* private fields */ }Expand description
A validated language tag and optional localization preview.
Implementations§
Source§impl Locale
impl Locale
Sourcepub fn parse(tag: &str) -> Result<Self, LocalizationError>
pub fn parse(tag: &str) -> Result<Self, LocalizationError>
Parses a language tag such as sr-Latn or ar-EG.
Valid BCP 47 extensions and private-use subtags are ignored for catalog selection.
Sourcepub fn with_preview(self, preview: PreviewMode) -> Self
pub fn with_preview(self, preview: PreviewMode) -> Self
Uses this language with the selected visual stress test.
Trait Implementations§
impl Eq for Locale
impl StructuralPartialEq for Locale
Auto Trait Implementations§
impl Freeze for Locale
impl RefUnwindSafe for Locale
impl Send for Locale
impl Sync for Locale
impl Unpin for Locale
impl UnsafeUnpin for Locale
impl UnwindSafe for Locale
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