icu_provider_source/cldr_serde/currencies/
data.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
// This file is part of ICU4X. For terms of use, please see the file
// called LICENSE at the top level of the ICU4X source tree
// (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ).

//! Serde structs representing CLDR JSON numbers.json files.
//!
//! Sample file:
//! <https://github.com/unicode-org/cldr-json/blob/master/cldr-json/cldr-numbers-full/main/en/currencies.json>

use serde::Deserialize;
use std::collections::BTreeMap;

#[derive(PartialEq, Debug, Deserialize)]
pub(crate) struct CurrencyPatterns {
    #[serde(rename = "symbol")]
    pub(crate) short: Option<String>,

    #[serde(rename = "symbol-alt-narrow")]
    pub(crate) narrow: Option<String>,

    #[serde(rename = "displayName")]
    pub(crate) display_name: Option<String>,

    #[serde(rename = "displayName-count-0")]
    pub(crate) explicit_zero: Option<String>,

    #[serde(rename = "displayName-count-1")]
    pub(crate) explicit_one: Option<String>,

    #[serde(rename = "displayName-count-zero")]
    pub(crate) zero: Option<String>,

    #[serde(rename = "displayName-count-one")]
    pub(crate) one: Option<String>,

    #[serde(rename = "displayName-count-two")]
    pub(crate) two: Option<String>,

    #[serde(rename = "displayName-count-few")]
    pub(crate) few: Option<String>,

    #[serde(rename = "displayName-count-many")]
    pub(crate) many: Option<String>,

    #[serde(rename = "displayName-count-other")]
    pub(crate) other: Option<String>,
}

#[derive(PartialEq, Debug, Deserialize)]
pub(crate) struct Numbers {
    pub(crate) currencies: BTreeMap<String, CurrencyPatterns>,
}

#[derive(PartialEq, Debug, Deserialize)]
pub(crate) struct LangNumbers {
    pub(crate) numbers: Numbers,
}

pub(crate) type Resource = super::super::LocaleResource<LangNumbers>;