mangadex_api_types_rust/
result.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
use serde::{Deserialize, Serialize};

#[derive(Debug, Clone, Copy, Serialize, Deserialize, Hash, PartialEq, Eq)]
#[serde(rename_all = "snake_case")]
#[cfg_attr(feature = "specta", derive(specta::Type))]
#[cfg_attr(feature = "async-graphql", derive(async_graphql::Enum))]
pub enum ResultType {
    Ok,
    Error,
    Ko,
}

impl Default for ResultType {
    fn default() -> Self {
        Self::Ok
    }
}

impl ResultType {
    pub fn ok() -> Self {
        Self::Ok
    }
    pub fn error() -> Self {
        Self::Error
    }
    pub fn ko() -> Self {
        Self::Ko
    }
}