Skip to main content

ProtocolAdapter

Trait ProtocolAdapter 

Source
pub trait ProtocolAdapter: Send + Sync {
    // Required methods
    fn discover<'life0, 'life1, 'async_trait>(
        &'life0 self,
        url: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<RemoteCapabilities, String>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn invoke<'life0, 'life1, 'async_trait>(
        &'life0 self,
        url: &'life1 str,
        task: TaskRequest,
    ) -> Pin<Box<dyn Future<Output = Result<TaskHandle, String>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn stream<'life0, 'life1, 'async_trait>(
        &'life0 self,
        url: &'life1 str,
        task: TaskRequest,
    ) -> Pin<Box<dyn Future<Output = Result<TaskStream, String>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn status<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        url: &'life1 str,
        task_id: &'life2 str,
    ) -> Pin<Box<dyn Future<Output = Result<TaskStatus, String>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
    fn cancel<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        url: &'life1 str,
        task_id: &'life2 str,
    ) -> Pin<Box<dyn Future<Output = Result<(), String>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
}
Expand description

Protocol adapter trait — the core abstraction for delegate communication.

Implementations handle the full lifecycle: discovery, invocation, streaming, status polling, and cancellation.

Required Methods§

Source

fn discover<'life0, 'life1, 'async_trait>( &'life0 self, url: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<RemoteCapabilities, String>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Discover capabilities of a remote delegate.

Source

fn invoke<'life0, 'life1, 'async_trait>( &'life0 self, url: &'life1 str, task: TaskRequest, ) -> Pin<Box<dyn Future<Output = Result<TaskHandle, String>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Submit a task for execution and return a handle.

Source

fn stream<'life0, 'life1, 'async_trait>( &'life0 self, url: &'life1 str, task: TaskRequest, ) -> Pin<Box<dyn Future<Output = Result<TaskStream, String>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Submit a task and stream progress events.

Source

fn status<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, url: &'life1 str, task_id: &'life2 str, ) -> Pin<Box<dyn Future<Output = Result<TaskStatus, String>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Poll the current status of a submitted task.

Source

fn cancel<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, url: &'life1 str, task_id: &'life2 str, ) -> Pin<Box<dyn Future<Output = Result<(), String>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Cancel a running task.

Implementors§