Trait ResourceProvider

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

Source

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

Source

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

Source

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

Source

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,

Check if URI is supported

Source

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,

Validate URI format and access permissions

Implementors§