INNER CODE UNIT · Rust

generate_script_bridge_to_file

dontpanic92/OpenPAL3 · crosscom/ccidl-rs/src/lib.rs:161

pub fn generate_script_bridge_to_file(
    idl_path: impl AsRef<Path>,
    output_path: impl AsRef<Path>,
    consumer_crate: &str,
    bridge_root: &str,
) -> Result<Vec<PathBuf>, Error> {
    let generated = generate_script_bridge(idl_path, consumer_crate, bridge_root)?;
    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)
}

fn parse_file(path: &Path) -> Result<CrossComIdl, Error> {
    let content = std::fs::read_to_string(path).map_err(|source| Error::Io {
        path: path.to_path_buf(),
        source,

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…