Trait SimpleBackend

Source
pub trait SimpleBackend:
    Send
    + Sync
    + Clone {
    type Error: StdError + Send + Sync + Into<Error> + From<BackendError> + 'static;
    type Config: Clone + Send + Sync;

    // Required methods
    fn initialize<'async_trait>(
        config: Self::Config,
    ) -> Pin<Box<dyn Future<Output = Result<Self, Self::Error>> + Send + 'async_trait>>
       where Self: 'async_trait;
    fn get_server_info(&self) -> ServerInfo;
    fn health_check<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn list_tools<'life0, 'async_trait>(
        &'life0 self,
        request: PaginatedRequestParam,
    ) -> Pin<Box<dyn Future<Output = Result<ListToolsResult, Self::Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn call_tool<'life0, 'async_trait>(
        &'life0 self,
        request: CallToolRequestParam,
    ) -> Pin<Box<dyn Future<Output = Result<CallToolResult, Self::Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

Convenience trait for backends that don’t need all capabilities

Required Associated Types§

Required Methods§

Source

fn initialize<'async_trait>( config: Self::Config, ) -> Pin<Box<dyn Future<Output = Result<Self, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait,

Source

fn get_server_info(&self) -> ServerInfo

Source

fn health_check<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn list_tools<'life0, 'async_trait>( &'life0 self, request: PaginatedRequestParam, ) -> Pin<Box<dyn Future<Output = Result<ListToolsResult, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn call_tool<'life0, 'async_trait>( &'life0 self, request: CallToolRequestParam, ) -> Pin<Box<dyn Future<Output = Result<CallToolResult, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§