Trait ffi_helpers::task::Task [−][src]
pub trait Task: Send + Sync + Clone {
type Output: Send + Sync;
fn run(&self, cancel_tok: &CancellationToken) -> Result<Self::Output, Error>;
}
Expand description
A cancellable task which is meant to be run in a background thread.
For more information on the Task API, refer to the module documentation.
Associated Types
Required methods
Run this task to completion synchronously, exiting early if the
provided CancellationToken
is triggered.
You probably shouldn’t call this function directly. Instead prefer
higher level abstractions like TaskHandle::spawn()
or bindings
generated by the export_task!()
macro.