Skip to main content

A2aRequestHandlerExt

Trait A2aRequestHandlerExt 

Source
pub trait A2aRequestHandlerExt: A2aRequestHandler {
    // Required methods
    fn send_message<'a>(
        &'a self,
        request: SendMessageRequest,
        context: &'a A2aRequestContext,
    ) -> Pin<Box<dyn Future<Output = Result<SendMessageResponse, A2aError>> + Send + 'a>>;
    fn get_task<'a>(
        &'a self,
        request: GetTaskRequest,
        context: &'a A2aRequestContext,
    ) -> Pin<Box<dyn Future<Output = Result<GetTaskResponse, A2aError>> + Send + 'a>>;
    fn cancel_task<'a>(
        &'a self,
        request: CancelTaskRequest,
        context: &'a A2aRequestContext,
    ) -> Pin<Box<dyn Future<Output = Result<CancelTaskResponse, A2aError>> + Send + 'a>>;
    fn list_tasks<'a>(
        &'a self,
        request: ListTasksRequest,
        context: &'a A2aRequestContext,
    ) -> Pin<Box<dyn Future<Output = Result<ListTasksResponse, A2aError>> + Send + 'a>>;
    fn get_extended_agent_card<'a>(
        &'a self,
        request: GetExtendedAgentCardRequest,
        context: &'a A2aRequestContext,
    ) -> Pin<Box<dyn Future<Output = Result<GetExtendedAgentCardResponse, A2aError>> + Send + 'a>>;
    fn create_task_push_notification_config<'a>(
        &'a self,
        request: CreateTaskPushNotificationConfigRequest,
        context: &'a A2aRequestContext,
    ) -> Pin<Box<dyn Future<Output = Result<CreateTaskPushNotificationConfigResponse, A2aError>> + Send + 'a>>;
    fn get_task_push_notification_config<'a>(
        &'a self,
        request: GetTaskPushNotificationConfigRequest,
        context: &'a A2aRequestContext,
    ) -> Pin<Box<dyn Future<Output = Result<GetTaskPushNotificationConfigResponse, A2aError>> + Send + 'a>>;
    fn list_task_push_notification_configs<'a>(
        &'a self,
        request: ListTaskPushNotificationConfigsRequest,
        context: &'a A2aRequestContext,
    ) -> Pin<Box<dyn Future<Output = Result<ListTaskPushNotificationConfigsResponse, A2aError>> + Send + 'a>>;
    fn delete_task_push_notification_config<'a>(
        &'a self,
        request: DeleteTaskPushNotificationConfigRequest,
        context: &'a A2aRequestContext,
    ) -> Pin<Box<dyn Future<Output = Result<DeleteTaskPushNotificationConfigResponse, A2aError>> + Send + 'a>>;
}
Expand description

The per-method typed wrappers. A blanket impl means every A2aRequestHandler gets the typed methods for free.

Required Methods§

Source

fn send_message<'a>( &'a self, request: SendMessageRequest, context: &'a A2aRequestContext, ) -> Pin<Box<dyn Future<Output = Result<SendMessageResponse, A2aError>> + Send + 'a>>

Sends a message. Typed counterpart to dispatch(SendMessage, ...).

Source

fn get_task<'a>( &'a self, request: GetTaskRequest, context: &'a A2aRequestContext, ) -> Pin<Box<dyn Future<Output = Result<GetTaskResponse, A2aError>> + Send + 'a>>

Fetches a task. Typed counterpart to dispatch(GetTask, ...).

Source

fn cancel_task<'a>( &'a self, request: CancelTaskRequest, context: &'a A2aRequestContext, ) -> Pin<Box<dyn Future<Output = Result<CancelTaskResponse, A2aError>> + Send + 'a>>

Cancels a task. Typed counterpart to dispatch(CancelTask, ...).

Source

fn list_tasks<'a>( &'a self, request: ListTasksRequest, context: &'a A2aRequestContext, ) -> Pin<Box<dyn Future<Output = Result<ListTasksResponse, A2aError>> + Send + 'a>>

Lists tasks. Typed counterpart to dispatch(ListTasks, ...).

Source

fn get_extended_agent_card<'a>( &'a self, request: GetExtendedAgentCardRequest, context: &'a A2aRequestContext, ) -> Pin<Box<dyn Future<Output = Result<GetExtendedAgentCardResponse, A2aError>> + Send + 'a>>

Fetches the extended agent card. Typed counterpart to dispatch(GetExtendedAgentCard, ...).

Source

fn create_task_push_notification_config<'a>( &'a self, request: CreateTaskPushNotificationConfigRequest, context: &'a A2aRequestContext, ) -> Pin<Box<dyn Future<Output = Result<CreateTaskPushNotificationConfigResponse, A2aError>> + Send + 'a>>

Creates a push-notification config. Typed counterpart to dispatch(CreateTaskPushNotificationConfig, ...).

Source

fn get_task_push_notification_config<'a>( &'a self, request: GetTaskPushNotificationConfigRequest, context: &'a A2aRequestContext, ) -> Pin<Box<dyn Future<Output = Result<GetTaskPushNotificationConfigResponse, A2aError>> + Send + 'a>>

Fetches a push-notification config. Typed counterpart to dispatch(GetTaskPushNotificationConfig, ...).

Source

fn list_task_push_notification_configs<'a>( &'a self, request: ListTaskPushNotificationConfigsRequest, context: &'a A2aRequestContext, ) -> Pin<Box<dyn Future<Output = Result<ListTaskPushNotificationConfigsResponse, A2aError>> + Send + 'a>>

Lists push-notification configs. Typed counterpart to dispatch(ListTaskPushNotificationConfigs, ...).

Source

fn delete_task_push_notification_config<'a>( &'a self, request: DeleteTaskPushNotificationConfigRequest, context: &'a A2aRequestContext, ) -> Pin<Box<dyn Future<Output = Result<DeleteTaskPushNotificationConfigResponse, A2aError>> + Send + 'a>>

Deletes a push-notification config. Typed counterpart to dispatch(DeleteTaskPushNotificationConfig, ...).

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§