tirbofish/dropbear
main / crates / eucalyptus-core / src / ser / mod.rs · 711 bytes
crates/eucalyptus-core/src/ser/mod.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
30
use std::fmt::Display;
use std::string::ToString;
pub mod model;
pub mod templates;
pub enum SerializedType {
/// This is a `*.eucbin` file type.
GenericBinary,
/// This is a `*.eucmdl` file type.
Model,
}
impl Display for SerializedType {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let str = match self {
SerializedType::GenericBinary => "eucbin".to_string(),
SerializedType::Model => "eucmdl".to_string(),
};
write!(f, "{}", str)
}
}
impl SerializedType {
pub fn iter_extensions() -> impl Iterator<Item = String> {
[Self::GenericBinary.to_string(), Self::Model.to_string()].into_iter()
}
}