surrealpatch/core/src/sql/v2/language.rs

58 lines
1.2 KiB
Rust
Raw Normal View History

use revision::revisioned;
2023-05-10 02:08:09 +00:00
use serde::{Deserialize, Serialize};
use std::fmt;
use std::fmt::Display;
#[derive(Clone, Copy, Debug, Eq, PartialEq, PartialOrd, Serialize, Deserialize, Hash)]
2024-01-09 15:34:52 +00:00
#[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
#[revisioned(revision = 1)]
2023-05-10 02:08:09 +00:00
pub enum Language {
Arabic,
Danish,
Dutch,
2023-05-10 02:08:09 +00:00
English,
French,
German,
Greek,
Hungarian,
Italian,
Norwegian,
Portuguese,
Romanian,
Russian,
Spanish,
Swedish,
Tamil,
Turkish,
2023-05-10 02:08:09 +00:00
}
impl Language {
pub fn as_str(&self) -> &'static str {
match self {
Self::Arabic => "ARABIC",
Self::Danish => "DANISH",
Self::Dutch => "DUTCH",
2023-05-10 02:08:09 +00:00
Self::English => "ENGLISH",
Self::French => "FRENCH",
Self::German => "GERMAN",
Self::Greek => "GREEK",
Self::Hungarian => "HUNGARIAN",
Self::Italian => "ITALIAN",
Self::Norwegian => "NORWEGIAN",
Self::Portuguese => "PORTUGUESE",
Self::Romanian => "ROMANIAN",
Self::Russian => "RUSSIAN",
Self::Spanish => "SPANISH",
Self::Swedish => "SWEDISH",
Self::Tamil => "TAMIL",
Self::Turkish => "TURKISH",
}
}
}
impl Display for Language {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
f.write_str(self.as_str())
2023-05-10 02:08:09 +00:00
}
}