iyzipay_rust/model/
locale.rs

1use std::fmt;
2
3#[derive(Debug, Serialize, Deserialize, PartialEq)]
4#[serde(rename_all = "SCREAMING_SNAKE_CASE")]
5pub enum Locale {
6    EN,
7    TR,
8}
9
10impl Locale {
11    pub fn value(&self) -> &'static str {
12        match self {
13            Locale::EN => "en",
14            Locale::TR => "tr",
15        }
16    }
17}
18
19impl std::fmt::Display for Locale {
20    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
21        write!(f, "{}", self.value())
22    }
23}