Trait Provider

Source
pub trait Provider {
    type Error;

    // Required methods
    fn protocol_version(&self) -> ProtocolVersion;
    fn capabilities(&self) -> ServerCapabilities;
    fn implementation(&self) -> Implementation;
    fn list_prompts<'life0, 'async_trait>(
        &'life0 self,
        page: Option<String>,
    ) -> Pin<Box<dyn Future<Output = Result<(Vec<Prompt>, Option<String>), Self::Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn get_prompt<'life0, 'async_trait>(
        &'life0 self,
        name: String,
        arguments: Option<Map<String, Value>>,
    ) -> Pin<Box<dyn Future<Output = Result<(Vec<PromptMessage>, Option<String>), Self::Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn list_resources<'life0, 'async_trait>(
        &'life0 self,
        page: Option<String>,
    ) -> Pin<Box<dyn Future<Output = Result<(Vec<Annotated<RawResource>>, Option<String>), Self::Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn list_resource_templates<'life0, 'async_trait>(
        &'life0 self,
        page: Option<String>,
    ) -> Pin<Box<dyn Future<Output = Result<(Vec<ResourceTemplate>, Option<String>), Self::Error>> + 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<ResourceContents>, Self::Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn list_tools<'life0, 'async_trait>(
        &'life0 self,
        page: Option<String>,
    ) -> Pin<Box<dyn Future<Output = Result<(Vec<Tool>, Option<String>), Self::Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn call_tool<'life0, 'life1, 'async_trait>(
        &'life0 self,
        name: &'life1 str,
        arguments: Option<Map<String, Value>>,
    ) -> Pin<Box<dyn Future<Output = Result<(Vec<Content>, Option<bool>), Self::Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}

Required Associated Types§

Required Methods§

Source

fn protocol_version(&self) -> ProtocolVersion

Source

fn capabilities(&self) -> ServerCapabilities

Source

fn implementation(&self) -> Implementation

Source

fn list_prompts<'life0, 'async_trait>( &'life0 self, page: Option<String>, ) -> Pin<Box<dyn Future<Output = Result<(Vec<Prompt>, Option<String>), Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn get_prompt<'life0, 'async_trait>( &'life0 self, name: String, arguments: Option<Map<String, Value>>, ) -> Pin<Box<dyn Future<Output = Result<(Vec<PromptMessage>, Option<String>), Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn list_resources<'life0, 'async_trait>( &'life0 self, page: Option<String>, ) -> Pin<Box<dyn Future<Output = Result<(Vec<Annotated<RawResource>>, Option<String>), Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn list_resource_templates<'life0, 'async_trait>( &'life0 self, page: Option<String>, ) -> Pin<Box<dyn Future<Output = Result<(Vec<ResourceTemplate>, Option<String>), Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

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

Source

fn list_tools<'life0, 'async_trait>( &'life0 self, page: Option<String>, ) -> Pin<Box<dyn Future<Output = Result<(Vec<Tool>, Option<String>), Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn call_tool<'life0, 'life1, 'async_trait>( &'life0 self, name: &'life1 str, arguments: Option<Map<String, Value>>, ) -> Pin<Box<dyn Future<Output = Result<(Vec<Content>, Option<bool>), Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Implementors§