metaculus/models/
value_enum.rs

1/*
2 * Metaculus API
3 *
4 * Welcome to the unofficial Rust client for the Metaculus API
5 *
6 * The version of the OpenAPI document: 1.0
7 * Contact: Benjamin Manns <opensource@benmanns.com>
8 * Generated by: https://openapi-generator.tech
9 */
10
11use serde_repr::{Deserialize_repr, Serialize_repr};
12
13///
14#[derive(
15    Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize_repr, Deserialize_repr,
16)]
17#[repr(i32)]
18pub enum ValueEnum {
19    #[serde(rename = "0")]
20    Neutral = 0,
21    #[serde(rename = "-1")]
22    Down = -1,
23    #[serde(rename = "1")]
24    Up = 1,
25}
26
27impl ToString for ValueEnum {
28    fn to_string(&self) -> String {
29        match self {
30            Self::Neutral => String::from("0"),
31            Self::Down => String::from("-1"),
32            Self::Up => String::from("1"),
33        }
34    }
35}
36
37impl Default for ValueEnum {
38    fn default() -> ValueEnum {
39        Self::Neutral
40    }
41}