Trait OutputHandler

Source
pub trait OutputHandler<'state> {
    type FileHandle: Write;

    // Required method
    fn create_file<P: AsRef<Path>>(
        &'state mut self,
        path: P,
    ) -> Result<Self::FileHandle, GeneratorError>;
}
Expand description

Outputs files produced by the generator.

Allows for capturing the output without writing directly to the file system.

Required Associated Types§

Required Methods§

Source

fn create_file<P: AsRef<Path>>( &'state mut self, path: P, ) -> Result<Self::FileHandle, GeneratorError>

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<'output> OutputHandler<'output> for FileOutputHandler

Source§

impl<'output> OutputHandler<'output> for MemoryOutputHandler

Source§

type FileHandle = &'output mut Vec<u8>