Skip to main content

appwrite/enums/
adapter.rs

1use serde::{Deserialize, Serialize};
2
3#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize, Default)]
4pub enum Adapter {
5    #[serde(rename = "static")]
6    #[default]
7    Static,
8    #[serde(rename = "ssr")]
9    Ssr,
10}
11
12impl Adapter {
13    /// Get the string value of the enum
14    pub fn as_str(&self) -> &str {
15        match self {
16            Adapter::Static => "static",
17            Adapter::Ssr => "ssr",
18        }
19    }
20}
21
22impl std::fmt::Display for Adapter {
23    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
24        write!(f, "{}", self.as_str())
25    }
26}