ResourceSubscriptionHandler

Trait ResourceSubscriptionHandler 

Source
pub trait ResourceSubscriptionHandler: Send + Sync {
    // Required methods
    fn subscribe<'life0, 'async_trait>(
        &'life0 self,
        uri: String,
    ) -> Pin<Box<dyn Future<Output = MCPResult<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn unsubscribe<'life0, 'async_trait>(
        &'life0 self,
        uri: String,
    ) -> Pin<Box<dyn Future<Output = MCPResult<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn notify_change<'life0, 'async_trait>(
        &'life0 self,
        uri: String,
        content: Value,
    ) -> Pin<Box<dyn Future<Output = MCPResult<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

Resource subscription handler trait

Required Methods§

Source

fn subscribe<'life0, 'async_trait>( &'life0 self, uri: String, ) -> Pin<Box<dyn Future<Output = MCPResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Subscribe to a resource

Source

fn unsubscribe<'life0, 'async_trait>( &'life0 self, uri: String, ) -> Pin<Box<dyn Future<Output = MCPResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Unsubscribe from a resource

Source

fn notify_change<'life0, 'async_trait>( &'life0 self, uri: String, content: Value, ) -> Pin<Box<dyn Future<Output = MCPResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Notify about a resource change

Implementors§