[−][src]Enum num_format::Locale
A key type. Represents formats from the Unicode Consortium's
Common Locale Data Repository (CLDR). Implements Format.
Example
use num_format::{Buffer, Locale}; fn main() { // Using the French format from the Unicode Common Locale Data Repository... let mut buf = Buffer::new(); buf.write_formatted(&(-1000000), &Locale::fr); assert_eq!("-1\u{202f}000\u{202f}000", buf.as_str()); // Note: // U+202F is the "NARROW NO-BREAK SPACE" code point. // When displayed to the screen, it looks like a space. }
Variants
afaf_NAagqakamarar_AEar_BHar_DJar_DZar_EGar_EHar_ERar_ILar_IQar_JOar_KMar_KWar_LBar_LYar_MAar_MRar_OMar_PSar_QAar_SAar_SDar_SOar_SSar_SYar_TDar_TNar_YEas_asaastazaz_Cyrlaz_Latnbasbebembezbgbmbnbn_INbobo_INbrbrxbsbs_Cyrlbs_Latncaca_ADca_ES_VALENCIAca_FRca_ITccpccp_INcecggchrckbckb_IRcscucydada_GLdavdede_ATde_BEde_CHde_ITde_LIde_LUdjedsbduadyodzebueeee_TGelel_CYenen_001en_150en_AGen_AIen_ASen_ATen_AUen_BBen_BEen_BIen_BMen_BSen_BWen_BZen_CAen_CCen_CHen_CKen_CMen_CXen_CYen_DEen_DGen_DKen_DMen_ERen_FIen_FJen_FKen_FMen_GBen_GDen_GGen_GHen_GIen_GMen_GUen_GYen_HKen_IEen_ILen_IMen_INen_IOen_JEen_JMen_KEen_KIen_KNen_KYen_LCen_LRen_LSen_MGen_MHen_MOen_MPen_MSen_MTen_MUen_MWen_MYen_NAen_NFen_NGen_NLen_NRen_NUen_NZen_PGen_PHen_PKen_PNen_PRen_PWen_RWen_SBen_SCen_SDen_SEen_SGen_SHen_SIen_SLen_SSen_SXen_SZen_TCen_TKen_TOen_TTen_TVen_TZen_UGen_UMen_US_POSIXen_VCen_VGen_VIen_VUen_WSen_ZAen_ZMen_ZWeoeses_419es_ARes_BOes_BRes_BZes_CLes_COes_CRes_CUes_DOes_EAes_ECes_GQes_GTes_HNes_ICes_MXes_NIes_PAes_PEes_PHes_PRes_PYes_SVes_USes_UYes_VEeteuewofafa_AFffff_Latnff_Latn_BFff_Latn_CMff_Latn_GHff_Latn_GMff_Latn_GNff_Latn_GWff_Latn_LRff_Latn_MRff_Latn_NEff_Latn_NGff_Latn_SLfifilfofo_DKfrfr_BEfr_BFfr_BIfr_BJfr_BLfr_CAfr_CDfr_CFfr_CGfr_CHfr_CIfr_CMfr_DJfr_DZfr_GAfr_GFfr_GNfr_GPfr_GQfr_HTfr_KMfr_LUfr_MAfr_MCfr_MFfr_MGfr_MLfr_MQfr_MRfr_MUfr_NCfr_NEfr_PFfr_PMfr_REfr_RWfr_SCfr_SNfr_SYfr_TDfr_TGfr_TNfr_VUfr_WFfr_YTfurfygagdglgswgsw_FRgsw_LIguguzgvhaha_GHha_NEhawhehihrhr_BAhsbhuhyiaidigiiisitit_CHit_SMit_VAjajgojmcjvkakabkamkdekeakhqkikkkkjklklnkmknkoko_KPkokksksbksfkshkukwkylaglblglktlnln_AOln_CFln_CGlolrclrc_IQltluluoluylvmasmas_TZmermfemgmghmgomimkmlmnmrmsms_BNms_SGmtmuamymznnaqnbnb_SJndndsnds_NLnene_INnlnl_AWnl_BEnl_BQnl_CWnl_SRnl_SXnmgnnnnhnusnynomom_KEorosos_RUpapa_Arabpa_Guruplprgpsptpt_AOpt_CHpt_CVpt_GQpt_GWpt_LUpt_MOpt_MZpt_PTpt_STpt_TLququ_BOqu_ECrmrnroro_MDrofrootruru_BYru_KGru_KZru_MDru_UArwrwksahsaqsbpsdsese_FIse_SEsehsessgshishi_Latnshi_Tfngsiskslsmnsnsoso_DJso_ETso_KEsqsq_MKsq_XKsrsr_Cyrlsr_Cyrl_BAsr_Cyrl_MEsr_Cyrl_XKsr_Latnsr_Latn_BAsr_Latn_MEsr_Latn_XKsvsv_AXsv_FIswsw_CDsw_KEsw_UGtata_LKta_MYta_SGteteoteo_KEtgthtiti_ERtktotrtr_CYtttwqtzmugukurur_INuzuz_Arabuz_Cyrluz_Latnvaivai_Latnvai_Vaiivivovunwaewoxhxogyavyiyoyo_BJyueyue_Hansyue_Hantzghzhzh_Hanszh_Hans_HKzh_Hans_MOzh_Hans_SGzh_Hantzh_Hant_HKzh_Hant_MOzuMethods
impl Locale[src]
pub fn from_name<S>(name: S) -> Result<Locale, Error> where
S: AsRef<str>, [src]
S: AsRef<str>,
Constructs a Locale from its name. For a list of available names, see
available_names.
Errors
Returns an error if the name provided cannot be
parsed into a Locale.
pub fn available_names() -> &'static [&'static str][src]
Returns a static slice of all available names.
pub fn decimal(&self) -> &'static str[src]
Returns the locale's decimal representation.
pub fn grouping(&self) -> Grouping[src]
Returns the locale's Grouping.
pub fn infinity(&self) -> &'static str[src]
Returns the locale's infinity representation.
pub fn minus_sign(&self) -> &'static str[src]
Returns the locale's minus sign representation.
pub fn name(&self) -> &'static str[src]
Returns the locale's name.
pub fn nan(&self) -> &'static str[src]
Returns the locale's NaN representation.
pub fn plus_sign(&self) -> &'static str[src]
Returns the locale's plus sign representation.
pub fn separator(&self) -> &'static str[src]
Returns the locale's separator representation, if any.
Trait Implementations
impl Format for Locale[src]
fn decimal(&self) -> DecimalStr[src]
fn grouping(&self) -> Grouping[src]
fn infinity(&self) -> InfinityStr[src]
fn minus_sign(&self) -> MinusSignStr[src]
fn nan(&self) -> NanStr[src]
fn plus_sign(&self) -> PlusSignStr[src]
fn separator(&self) -> SeparatorStr[src]
impl PartialOrd<Locale> for Locale[src]
fn partial_cmp(&self, other: &Locale) -> Option<Ordering>[src]
#[must_use]
fn lt(&self, other: &Rhs) -> bool1.0.0[src]
This method tests less than (for self and other) and is used by the < operator. Read more
#[must_use]
fn le(&self, other: &Rhs) -> bool1.0.0[src]
This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
#[must_use]
fn gt(&self, other: &Rhs) -> bool1.0.0[src]
This method tests greater than (for self and other) and is used by the > operator. Read more
#[must_use]
fn ge(&self, other: &Rhs) -> bool1.0.0[src]
This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
impl From<Locale> for CustomFormat[src]
impl From<Locale> for CustomFormatBuilder[src]
impl Ord for Locale[src]
fn cmp(&self, other: &Locale) -> Ordering[src]
fn max(self, other: Self) -> Self1.21.0[src]
Compares and returns the maximum of two values. Read more
fn min(self, other: Self) -> Self1.21.0[src]
Compares and returns the minimum of two values. Read more
impl Eq for Locale[src]
impl Copy for Locale[src]
impl Clone for Locale[src]
fn clone(&self) -> Locale[src]
fn clone_from(&mut self, source: &Self)1.0.0[src]
Performs copy-assignment from source. Read more
impl PartialEq<Locale> for Locale[src]
fn eq(&self, other: &Locale) -> bool[src]
#[must_use]
fn ne(&self, other: &Rhs) -> bool1.0.0[src]
This method tests for !=.
impl Hash for Locale[src]
fn hash<__H: Hasher>(&self, state: &mut __H)[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher, 1.3.0[src]
H: Hasher,
Feeds a slice of this type into the given [Hasher]. Read more
impl Debug for Locale[src]
impl FromStr for Locale[src]
Auto Trait Implementations
Blanket Implementations
impl<T> From for T[src]
impl<T, U> Into for T where
U: From<T>, [src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone, [src]
T: Clone,
impl<T, U> TryFrom for T where
U: Into<T>, [src]
U: Into<T>,
type Error = !
try_from)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T> Borrow for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> BorrowMut for T where
T: ?Sized, [src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T[src]
impl<T, U> TryInto for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,