Trait RawHandler

Source
pub trait RawHandler {
    // Required methods
    fn selector(&self) -> &WorkerSelector;
    fn output_format(&self) -> TaskDataFormat;
    fn supported_task(&self) -> Option<SupportedTask>;
    fn run<'life0, 'async_trait>(
        &'life0 self,
        context: TaskContext,
        task: TaskDefinition,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<u8>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

A handler that works with raw input and output without task type attached.

Required Methods§

Source

fn selector(&self) -> &WorkerSelector

Return the selector that should be used to match tasks to this handler.

Source

fn output_format(&self) -> TaskDataFormat

The data format of the task output.

Source

fn supported_task(&self) -> Option<SupportedTask>

Optional information about the supported task expected by this handler.

Source

fn run<'life0, 'async_trait>( &'life0 self, context: TaskContext, task: TaskDefinition, ) -> Pin<Box<dyn Future<Output = Result<Vec<u8>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Execute a task.

Implementors§