scud_task_core/formats/
mod.rs1mod scg;
7
8pub use scg::{natural_sort_ids, parse_scg, serialize_scg, validate_weave};
9
10#[derive(Debug, Clone, Copy, PartialEq)]
12pub enum Format {
13 Json,
15 Scg,
17}
18
19impl Format {
20 pub fn from_extension(ext: &str) -> Option<Self> {
21 match ext.to_lowercase().as_str() {
22 "json" => Some(Format::Json),
23 "scg" => Some(Format::Scg),
24 _ => None,
25 }
26 }
27
28 pub fn extension(&self) -> &'static str {
29 match self {
30 Format::Json => "json",
31 Format::Scg => "scg",
32 }
33 }
34}