use cwl::v11::CwlDocument; use cwl::v11_clt::CommandLineTool; use cwl::v11_wf::Workflow; use std::fs::File; use std::io::BufReader; type FResult = Result; #[allow(dead_code)] pub fn load(path: &str) -> FResult { let file = File::open(path).unwrap(); let buf_reader = BufReader::new(file); CwlDocument::from_reader(buf_reader) } #[allow(dead_code)] pub fn unpack_clt(doc: CwlDocument) -> Option { if let CwlDocument::CommandLineTool(clt) = doc { Some(clt) } else { None } } #[allow(dead_code)] pub fn unpack_wf(doc: CwlDocument) -> Option { if let CwlDocument::Workflow(wf) = doc { Some(wf) } else { None } }