1mod scg;
7
8pub use scg::{
9 natural_sort_ids, parse_scg, parse_scg_result, serialize_scg, serialize_scg_pipeline,
10 PipelineNodeAttrs, ScgEdgeAttrs, ScgParseResult, ScgPipeline,
11};
12
13#[derive(Debug, Clone, Copy, PartialEq)]
15pub enum Format {
16 Json,
18 Scg,
20}
21
22impl Format {
23 pub fn from_extension(ext: &str) -> Option<Self> {
24 match ext.to_lowercase().as_str() {
25 "json" => Some(Format::Json),
26 "scg" => Some(Format::Scg),
27 _ => None,
28 }
29 }
30
31 pub fn extension(&self) -> &'static str {
32 match self {
33 Format::Json => "json",
34 Format::Scg => "scg",
35 }
36 }
37}