Skip to main content

TaskConnectionResolver

Trait TaskConnectionResolver 

Source
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§

Source

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§

Source§

impl Debug for dyn TaskConnectionResolver

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§