Skip to main content

TaskSink

Trait TaskSink 

Source
pub trait TaskSink: Send + Sync {
    // Required methods
    fn state<'life0, 'async_trait>(
        &'life0 self,
        state: SessionTaskState,
        detail: Option<String>,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn progress<'life0, 'async_trait>(
        &'life0 self,
        progress: TaskProgress,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn output<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        stream: &'life1 str,
        delta: &'life2 str,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
    fn post<'life0, 'async_trait>(
        &'life0 self,
        message: NewTaskMessage,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn request_input<'life0, 'async_trait>(
        &'life0 self,
        request: TaskInputRequest,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn artifact<'life0, 'async_trait>(
        &'life0 self,
        artifact: TaskArtifact,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

Report plane handed to running work. state/progress/request_input mutate the task record (snapshot events fire); post appends to the message channel; output is high-frequency and ephemeral.

Required Methods§

Source

fn state<'life0, 'async_trait>( &'life0 self, state: SessionTaskState, detail: Option<String>, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn progress<'life0, 'async_trait>( &'life0 self, progress: TaskProgress, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn output<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, stream: &'life1 str, delta: &'life2 str, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

High-frequency output delta. Not persisted on the task record.

Source

fn post<'life0, 'async_trait>( &'life0 self, message: NewTaskMessage, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Outbound message to the session; may wake the parent per wake policy.

Source

fn request_input<'life0, 'async_trait>( &'life0 self, request: TaskInputRequest, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Ask the session for input; transitions the task to awaiting_input.

Source

fn artifact<'life0, 'async_trait>( &'life0 self, artifact: TaskArtifact, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§