Skip to main content

MediaExecutor

Trait MediaExecutor 

Source
pub trait MediaExecutor: Send + Sync {
    // Required methods
    fn execute<'life0, 'life1, 'life2, 'life3, 'async_trait>(
        &'life0 self,
        source: &'life1 FileSource,
        ops: &'life2 [MediaOp],
        sink: Option<&'life3 FileSink>,
    ) -> Pin<Box<dyn Future<Output = AppResult<FileSource>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait,
             'life3: 'async_trait;
    fn execute_with_progress<'life0, 'life1, 'life2, 'life3, 'async_trait>(
        &'life0 self,
        source: &'life1 FileSource,
        ops: &'life2 [MediaOp],
        sink: Option<&'life3 FileSink>,
        on_progress: Box<dyn Fn(Progress) + Send + Sync>,
    ) -> Pin<Box<dyn Future<Output = AppResult<FileSource>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait,
             'life3: 'async_trait;
    fn supports(&self, op: &MediaOp) -> bool;
    fn preview(
        &self,
        source: &FileSource,
        ops: &[MediaOp],
    ) -> AppResult<Vec<String>>;

    // Provided method
    fn execute_cancellable<'life0, 'life1, 'life2, 'life3, 'async_trait>(
        &'life0 self,
        source: &'life1 FileSource,
        ops: &'life2 [MediaOp],
        sink: Option<&'life3 FileSink>,
        on_progress: Option<Box<dyn Fn(Progress) + Send + Sync>>,
        _cancel: CancellationToken,
    ) -> Pin<Box<dyn Future<Output = AppResult<FileSource>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait,
             'life3: 'async_trait { ... }
}
Expand description

Backend that can execute a media pipeline.

Required Methods§

Source

fn execute<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, source: &'life1 FileSource, ops: &'life2 [MediaOp], sink: Option<&'life3 FileSink>, ) -> Pin<Box<dyn Future<Output = AppResult<FileSource>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

Execute a sequence of operations on a source.

Source

fn execute_with_progress<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, source: &'life1 FileSource, ops: &'life2 [MediaOp], sink: Option<&'life3 FileSink>, on_progress: Box<dyn Fn(Progress) + Send + Sync>, ) -> Pin<Box<dyn Future<Output = AppResult<FileSource>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

Execute with progress reporting.

Source

fn supports(&self, op: &MediaOp) -> bool

Check if this executor supports a given operation.

Source

fn preview( &self, source: &FileSource, ops: &[MediaOp], ) -> AppResult<Vec<String>>

Dry run: return the command(s) that would be executed.

Provided Methods§

Source

fn execute_cancellable<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, source: &'life1 FileSource, ops: &'life2 [MediaOp], sink: Option<&'life3 FileSink>, on_progress: Option<Box<dyn Fn(Progress) + Send + Sync>>, _cancel: CancellationToken, ) -> Pin<Box<dyn Future<Output = AppResult<FileSource>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

Execute with cancellation support.

The default implementation ignores the token and delegates to execute. Backends should override this to honour cancellation (e.g. kill a subprocess).

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§