pub trait ResourceProvider: Send + Sync {
// Required methods
fn list_resources<'life0, 'async_trait>(
&'life0 self,
cursor: Option<String>,
) -> Pin<Box<dyn Future<Output = Result<(Vec<Resource>, Option<String>), McpError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn read_resource<'life0, 'life1, 'async_trait>(
&'life0 self,
uri: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<ResourceContent>, McpError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn list_templates<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<ResourceTemplate>, McpError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn supports_uri<'life0, 'life1, 'async_trait>(
&'life0 self,
uri: &'life1 str,
) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn validate_uri<'life0, 'life1, 'async_trait>(
&'life0 self,
uri: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<(), McpError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
}
Required Methods§
Sourcefn list_resources<'life0, 'async_trait>(
&'life0 self,
cursor: Option<String>,
) -> Pin<Box<dyn Future<Output = Result<(Vec<Resource>, Option<String>), McpError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn list_resources<'life0, 'async_trait>(
&'life0 self,
cursor: Option<String>,
) -> Pin<Box<dyn Future<Output = Result<(Vec<Resource>, Option<String>), McpError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
List available resources
Sourcefn read_resource<'life0, 'life1, 'async_trait>(
&'life0 self,
uri: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<ResourceContent>, McpError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn read_resource<'life0, 'life1, 'async_trait>(
&'life0 self,
uri: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<ResourceContent>, McpError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Read resource contents
Sourcefn list_templates<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<ResourceTemplate>, McpError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn list_templates<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<ResourceTemplate>, McpError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
List available templates