pub trait RunControl: Send + Sync {
// Required methods
fn request_cancel<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
key: &'life1 ThreadKey,
context: &'life2 InvocationContext,
) -> Pin<Box<dyn Future<Output = Result<(), StoreError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
fn is_cancel_requested<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
key: &'life1 ThreadKey,
run_id: &'life2 RunId,
) -> Pin<Box<dyn Future<Output = Result<bool, StoreError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
fn wait_for_cancel<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
key: &'life1 ThreadKey,
run_id: &'life2 RunId,
) -> Pin<Box<dyn Future<Output = Result<(), StoreError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
fn clear_cancel<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
key: &'life1 ThreadKey,
run_id: &'life2 RunId,
) -> Pin<Box<dyn Future<Output = Result<(), StoreError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
}Expand description
Process-local cooperative cancellation signal for a live execution attempt.
Required Methods§
Sourcefn request_cancel<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
key: &'life1 ThreadKey,
context: &'life2 InvocationContext,
) -> Pin<Box<dyn Future<Output = Result<(), StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn request_cancel<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
key: &'life1 ThreadKey,
context: &'life2 InvocationContext,
) -> Pin<Box<dyn Future<Output = Result<(), StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Requests cancellation idempotently.
The full invocation context prevents collisions between users, scopes, threads, and runs inside one process.
Sourcefn is_cancel_requested<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
key: &'life1 ThreadKey,
run_id: &'life2 RunId,
) -> Pin<Box<dyn Future<Output = Result<bool, StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn is_cancel_requested<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
key: &'life1 ThreadKey,
run_id: &'life2 RunId,
) -> Pin<Box<dyn Future<Output = Result<bool, StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Returns whether cancellation has been requested.
Sourcefn wait_for_cancel<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
key: &'life1 ThreadKey,
run_id: &'life2 RunId,
) -> Pin<Box<dyn Future<Output = Result<(), StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn wait_for_cancel<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
key: &'life1 ThreadKey,
run_id: &'life2 RunId,
) -> Pin<Box<dyn Future<Output = Result<(), StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Waits until cancellation is requested, allowing Runtime to drop an in-flight external operation and stop the execution attempt.
Sourcefn clear_cancel<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
key: &'life1 ThreadKey,
run_id: &'life2 RunId,
) -> Pin<Box<dyn Future<Output = Result<(), StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn clear_cancel<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
key: &'life1 ThreadKey,
run_id: &'life2 RunId,
) -> Pin<Box<dyn Future<Output = Result<(), StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Clears the cancellation signal after a run has settled.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".