Skip to main content

FileWriter

Trait FileWriter 

Source
pub trait FileWriter {
    // Provided methods
    fn source_dir(&self) -> Option<&str> { ... }
    fn write_files(
        &self,
        output_dir: &Path,
        files: &[FileInfo],
    ) -> Result<(), Box<dyn Error + Send + Sync>> { ... }
}
Expand description

Trait for language-specific file writing operations

Provided Methods§

Source

fn source_dir(&self) -> Option<&str>

Optional source directory prefix for languages that use one (e.g. "src" for Rust). When set, source file categories (Apis, Models, Runtime) are placed under {output_dir}/{source_dir}/ instead of directly under {output_dir}/.

Source

fn write_files( &self, output_dir: &Path, files: &[FileInfo], ) -> Result<(), Box<dyn Error + Send + Sync>>

Write generated files to the output directory

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§