backend/model/enum/
layer_type.rsuse core::fmt;
use diesel_derive_enum::DbEnum;
use serde::{Deserialize, Serialize};
use typeshare::typeshare;
use utoipa::ToSchema;
#[typeshare]
#[derive(Serialize, Deserialize, DbEnum, Debug, ToSchema, Clone, Copy, PartialEq, Eq)]
#[ExistingTypePath = "crate::schema::sql_types::LayerType"]
pub enum LayerType {
#[serde(rename = "base")]
#[db_rename = "base"]
Base,
#[serde(rename = "soiltexture")]
#[db_rename = "soiltexture"]
Soiltexture,
#[serde(rename = "todo")]
#[db_rename = "todo"]
Todo,
#[serde(rename = "label")]
#[db_rename = "label"]
Label,
#[serde(rename = "paths")]
#[db_rename = "paths"]
Paths,
#[serde(rename = "photo")]
#[db_rename = "photo"]
Photo,
#[serde(rename = "shade")]
#[db_rename = "shade"]
Shade,
#[serde(rename = "trees")]
#[db_rename = "trees"]
Trees,
#[serde(rename = "winds")]
#[db_rename = "winds"]
Winds,
#[serde(rename = "zones")]
#[db_rename = "zones"]
Zones,
#[serde(rename = "plants")]
#[db_rename = "plants"]
Plants,
#[serde(rename = "drawing")]
#[db_rename = "drawing"]
Drawing,
#[serde(rename = "terrain")]
#[db_rename = "terrain"]
Terrain,
#[serde(rename = "habitats")]
#[db_rename = "habitats"]
Habitats,
#[serde(rename = "warnings")]
#[db_rename = "warnings"]
Warnings,
#[serde(rename = "watering")]
#[db_rename = "watering"]
Watering,
#[serde(rename = "landscape")]
#[db_rename = "landscape"]
Landscape,
#[serde(rename = "hydrology")]
#[db_rename = "hydrology"]
Hydrology,
#[serde(rename = "fertilization")]
#[db_rename = "fertilization"]
Fertilization,
#[serde(rename = "infrastructure")]
#[db_rename = "infrastructure"]
Infrastructure,
}
impl fmt::Display for LayerType {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
match self {
Self::Base => write!(f, "Base"),
Self::Soiltexture => write!(f, "Soiltexture"),
Self::Todo => write!(f, "Todo"),
Self::Label => write!(f, "Label"),
Self::Paths => write!(f, "Paths"),
Self::Photo => write!(f, "Photo"),
Self::Shade => write!(f, "Shade"),
Self::Trees => write!(f, "Trees"),
Self::Winds => write!(f, "Winds"),
Self::Zones => write!(f, "Zones"),
Self::Plants => write!(f, "Plants"),
Self::Drawing => write!(f, "Drawing"),
Self::Terrain => write!(f, "Terrain"),
Self::Habitats => write!(f, "Habitats"),
Self::Warnings => write!(f, "Warnings"),
Self::Watering => write!(f, "Watering"),
Self::Landscape => write!(f, "Landscape"),
Self::Hydrology => write!(f, "Hydrology"),
Self::Fertilization => write!(f, "Fertilization"),
Self::Infrastructure => write!(f, "Infrastructure"),
}
}
}