Skip to main content

WriterFactory

Trait WriterFactory 

Source
pub trait WriterFactory {
    type Writer: AsyncFileWriter;

    // Required methods
    fn create(
        &mut self,
        file_path: &str,
        write_buffer_size: usize,
        cancellation: Option<&CancellationToken>,
    ) -> impl Future<Output = Result<Self::Writer>>;
    fn abort(writer: Self::Writer) -> impl Future<Output = Result<()>>;
}

Required Associated Types§

Source

type Writer: AsyncFileWriter

Required Methods§

Source

fn create( &mut self, file_path: &str, write_buffer_size: usize, cancellation: Option<&CancellationToken>, ) -> impl Future<Output = Result<Self::Writer>>

Opens output with the same cancellation signal as its encoders.

Source

fn abort(writer: Self::Writer) -> impl Future<Output = Result<()>>

Aborts unfinished output after all encoders have stopped using it.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§