pub struct ICU4XLocale(pub Locale);Expand description
An ICU4X Locale, capable of representing strings like "en-US".
Tuple Fields§
§0: LocaleImplementations§
Source§impl ICU4XLocale
impl ICU4XLocale
Sourcepub fn create_from_string(
name: &DiplomatStr,
) -> Result<Box<ICU4XLocale>, ICU4XError>
pub fn create_from_string( name: &DiplomatStr, ) -> Result<Box<ICU4XLocale>, ICU4XError>
Construct an ICU4XLocale from an locale identifier.
This will run the complete locale parsing algorithm. If code size and
performance are critical and the locale is of a known shape (such as
aa-BB) use create_und, set_language, set_script, and set_region.
Sourcepub fn create_und() -> Box<ICU4XLocale>
pub fn create_und() -> Box<ICU4XLocale>
Construct a default undefined ICU4XLocale “und”.
Sourcepub fn clone(&self) -> Box<ICU4XLocale>
pub fn clone(&self) -> Box<ICU4XLocale>
Clones the ICU4XLocale.
Sourcepub fn basename(&self, write: &mut DiplomatWriteable) -> Result<(), ICU4XError>
pub fn basename(&self, write: &mut DiplomatWriteable) -> Result<(), ICU4XError>
Write a string representation of the LanguageIdentifier part of
ICU4XLocale to write.
Sourcepub fn get_unicode_extension(
&self,
bytes: &DiplomatStr,
write: &mut DiplomatWriteable,
) -> Result<(), ICU4XError>
pub fn get_unicode_extension( &self, bytes: &DiplomatStr, write: &mut DiplomatWriteable, ) -> Result<(), ICU4XError>
Write a string representation of the unicode extension to write
Sourcepub fn language(&self, write: &mut DiplomatWriteable) -> Result<(), ICU4XError>
pub fn language(&self, write: &mut DiplomatWriteable) -> Result<(), ICU4XError>
Write a string representation of ICU4XLocale language to write
Sourcepub fn set_language(&mut self, bytes: &DiplomatStr) -> Result<(), ICU4XError>
pub fn set_language(&mut self, bytes: &DiplomatStr) -> Result<(), ICU4XError>
Set the language part of the ICU4XLocale.
Sourcepub fn region(&self, write: &mut DiplomatWriteable) -> Result<(), ICU4XError>
pub fn region(&self, write: &mut DiplomatWriteable) -> Result<(), ICU4XError>
Write a string representation of ICU4XLocale region to write
Sourcepub fn set_region(&mut self, bytes: &DiplomatStr) -> Result<(), ICU4XError>
pub fn set_region(&mut self, bytes: &DiplomatStr) -> Result<(), ICU4XError>
Set the region part of the ICU4XLocale.
Sourcepub fn script(&self, write: &mut DiplomatWriteable) -> Result<(), ICU4XError>
pub fn script(&self, write: &mut DiplomatWriteable) -> Result<(), ICU4XError>
Write a string representation of ICU4XLocale script to write
Sourcepub fn set_script(&mut self, bytes: &DiplomatStr) -> Result<(), ICU4XError>
pub fn set_script(&mut self, bytes: &DiplomatStr) -> Result<(), ICU4XError>
Set the script part of the ICU4XLocale. Pass an empty string to remove the script.
Sourcepub fn canonicalize(
bytes: &DiplomatStr,
write: &mut DiplomatWriteable,
) -> Result<(), ICU4XError>
pub fn canonicalize( bytes: &DiplomatStr, write: &mut DiplomatWriteable, ) -> Result<(), ICU4XError>
Best effort locale canonicalizer that doesn’t need any data
Use ICU4XLocaleCanonicalizer for better control and functionality
Sourcepub fn to_string(&self, write: &mut DiplomatWriteable) -> Result<(), ICU4XError>
pub fn to_string(&self, write: &mut DiplomatWriteable) -> Result<(), ICU4XError>
Write a string representation of ICU4XLocale to write
pub fn normalizing_eq(&self, other: &DiplomatStr) -> bool
pub fn strict_cmp(&self, other: &DiplomatStr) -> ICU4XOrdering
pub fn strict_cmp_(&self, other: &DiplomatStr) -> Ordering
pub fn total_cmp(&self, other: &Self) -> ICU4XOrdering
pub fn total_cmp_(&self, other: &Self) -> Ordering
Source§impl ICU4XLocale
impl ICU4XLocale
pub fn to_datalocale(&self) -> DataLocale
Auto Trait Implementations§
impl Freeze for ICU4XLocale
impl RefUnwindSafe for ICU4XLocale
impl Send for ICU4XLocale
impl Sync for ICU4XLocale
impl Unpin for ICU4XLocale
impl UnwindSafe for ICU4XLocale
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> Filterable for T
impl<T> Filterable for T
Source§fn filterable(
self,
filter_name: &'static str,
) -> RequestFilterDataProvider<T, fn(DataRequest<'_>) -> bool>
fn filterable( self, filter_name: &'static str, ) -> RequestFilterDataProvider<T, fn(DataRequest<'_>) -> bool>
impl<T> ErasedDestructor for Twhere
T: 'static,
impl<T> MaybeSendSync for T
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...) attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 168 bytes