pub trait ExecutionHandlerRaw {
// Required methods
fn can_execute(&self, context: &ExecutionContext) -> bool;
fn execute<'life0, 'life1, 'async_trait>(
&'life0 self,
context: ExecutionContext,
input_json: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<String, String>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn job_type_metadata(&self) -> &JobTypeMetadata;
}
Expand description
A handler for executing jobs.
Required Methods§
Sourcefn can_execute(&self, context: &ExecutionContext) -> bool
fn can_execute(&self, context: &ExecutionContext) -> bool
Returns whether the handler can execute the given job execution.
Sourcefn execute<'life0, 'life1, 'async_trait>(
&'life0 self,
context: ExecutionContext,
input_json: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<String, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn execute<'life0, 'life1, 'async_trait>(
&'life0 self,
context: ExecutionContext,
input_json: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<String, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Execute the given job execution.
The Ok variant must be a valid JSON, while the Err variant must be an error message of any kind.
Note that while the input and outputs should be JSON, this might not be enforced by either the executor or the server.
Sourcefn job_type_metadata(&self) -> &JobTypeMetadata
fn job_type_metadata(&self) -> &JobTypeMetadata
Get information about the job type this handler can execute.