pub trait TaskConnectionResolver: Send + Sync {
// Required method
fn resolve_task_connection<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
task: &'life1 dyn Task,
hostname: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<Option<Arc<Mutex<dyn Connection>>>, GenjaError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
}Expand description
Opens or verifies task-scoped connections before execution.
The full runtime can implement this trait to ensure the connection selected by a task is available before the task body runs. Core task execution remains generic by depending only on this trait rather than on a concrete runtime type.
Required Methods§
Sourcefn resolve_task_connection<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
task: &'life1 dyn Task,
hostname: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<Option<Arc<Mutex<dyn Connection>>>, GenjaError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn resolve_task_connection<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
task: &'life1 dyn Task,
hostname: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<Option<Arc<Mutex<dyn Connection>>>, GenjaError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Open or retrieve the connection required by task for hostname.
Trait Implementations§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".