Skip to main content

PushNotificationSender

Trait PushNotificationSender 

Source
pub trait PushNotificationSender: Send + Sync {
    // Required methods
    fn send_status_update<'life0, 'life1, 'life2, 'life3, 'async_trait>(
        &'life0 self,
        url: &'life1 str,
        event: &'life2 TaskStatusUpdateEvent,
        config: &'life3 TaskPushNotificationConfig,
    ) -> Pin<Box<dyn Future<Output = Result<(), A2aError>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait,
             'life3: 'async_trait,
             Self: 'async_trait;
    fn send_artifact_update<'life0, 'life1, 'life2, 'life3, 'async_trait>(
        &'life0 self,
        url: &'life1 str,
        event: &'life2 TaskArtifactUpdateEvent,
        config: &'life3 TaskPushNotificationConfig,
    ) -> Pin<Box<dyn Future<Output = Result<(), A2aError>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait,
             'life3: 'async_trait,
             Self: 'async_trait;
}
Available on crate features a2a-v1 and server only.
Expand description

Async trait for delivering push notifications to webhook endpoints.

Implementations must be Send + Sync for use across async boundaries.

Required Methods§

Source

fn send_status_update<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, url: &'life1 str, event: &'life2 TaskStatusUpdateEvent, config: &'life3 TaskPushNotificationConfig, ) -> Pin<Box<dyn Future<Output = Result<(), A2aError>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait, Self: 'async_trait,

Delivers a task status update to the configured webhook.

Source

fn send_artifact_update<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, url: &'life1 str, event: &'life2 TaskArtifactUpdateEvent, config: &'life3 TaskPushNotificationConfig, ) -> Pin<Box<dyn Future<Output = Result<(), A2aError>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait, Self: 'async_trait,

Delivers a task artifact update to the configured webhook.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§