INNER CODE UNIT · Rust
generate_protosept
dontpanic92/OpenPAL3 · crosscom/ccidl-rs/src/lib.rs:78
pub fn generate_protosept(idl_path: impl AsRef<Path>) -> Result<GeneratedUnit, Error> {
let idl_path = idl_path.as_ref();
let mut dependencies = Vec::new();
let mut visited = HashSet::new();
collect_dependencies(idl_path, &mut visited, &mut dependencies)?;
let mut unit = parse_file(idl_path)?;
process_imports(idl_path, &mut unit)?;
let source = protosept::generate(unit)?;
Ok(GeneratedUnit {
source,
dependencies,
})
}
/// Convenience wrapper around [`generate_protosept`] that writes the result
/// to `output_path`.