Skip to main content

ResourceNotificationHandler

Trait ResourceNotificationHandler 

Source
pub trait ResourceNotificationHandler: Send + Sync {
    // Required methods
    fn handle_resource_updated<'life0, 'life1, 'async_trait>(
        &'life0 self,
        uri: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<(), Box<dyn Error + Sync + Send>>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             'life1: 'async_trait,
             Self: 'async_trait;
    fn handle_resource_list_changed<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<(), Box<dyn Error + Sync + Send>>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             Self: 'async_trait;
}
Available on crate feature tools only.
Expand description

Receives resource update notifications from an MCP server.

Register one handler on an McpToolset, McpHttpClientBuilder, or McpServerManager. The same handler is retained when ADK-Rust reconnects the underlying transport.

Required Methods§

Source

fn handle_resource_updated<'life0, 'life1, 'async_trait>( &'life0 self, uri: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<(), Box<dyn Error + Sync + Send>>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait,

Handle notifications/resources/updated for one concrete resource URI.

Source

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

Handle notifications/resources/list_changed.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§