gesha_rust_types/
preset_def.rs

1use crate::{Definition, ErrorDef, MediaTypeDef};
2
3#[derive(Clone, Debug, PartialEq)]
4pub enum PresetDef {
5    Error(ErrorDef),
6    /// rf. https://stackoverflow.com/q/44331037
7    Patch,
8    MediaType(MediaTypeDef),
9    FromJson,
10}
11
12impl PresetDef {
13    pub fn symbol_name(&self) -> &str {
14        match self {
15            PresetDef::Error(x) => x.symbol_name(),
16            PresetDef::Patch => "Patch",
17            PresetDef::MediaType(x) => x.symbol_name(),
18            PresetDef::FromJson => "FromJson",
19        }
20    }
21}
22
23impl From<PresetDef> for Definition {
24    fn from(this: PresetDef) -> Self {
25        Definition::PresetDef(this)
26    }
27}