INNER CODE UNIT · Rust
generate_to_file
dontpanic92/OpenPAL3 · crosscom/ccidl-rs/src/lib.rs:58
pub fn generate_to_file(
idl_path: impl AsRef<Path>,
output_path: impl AsRef<Path>,
) -> Result<Vec<PathBuf>, Error> {
let generated = generate(idl_path)?;
std::fs::write(output_path.as_ref(), generated.source).map_err(|source| Error::Io {
path: output_path.as_ref().to_path_buf(),
source,
})?;
Ok(generated.dependencies)
}
/// Generate a Protosept (`.p7`) source file for the given IDL.
///
/// The output declares one `proto` per IDL interface (with flattened
/// inheritance) and one `struct` per IDL class whose methods forward to
/// host functions named `<idl-rust-module>.<method>`. Methods whose IDL
/// signature contains types that cannot be represented in protosept (for