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§
Sourcefn 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 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