pub trait ResourceHandler: Send + Sync {
// Required methods
fn read<'life0, 'life1, 'async_trait>(
&'life0 self,
uri: &'life1 str,
extra: RequestHandlerExtra,
) -> Pin<Box<dyn Future<Output = Result<ReadResourceResult>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn list<'life0, 'async_trait>(
&'life0 self,
_cursor: Option<String>,
extra: RequestHandlerExtra,
) -> Pin<Box<dyn Future<Output = Result<ListResourcesResult>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
}Expand description
Handler for resource access.
Required Methods§
Sourcefn read<'life0, 'life1, 'async_trait>(
&'life0 self,
uri: &'life1 str,
extra: RequestHandlerExtra,
) -> Pin<Box<dyn Future<Output = Result<ReadResourceResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn read<'life0, 'life1, 'async_trait>(
&'life0 self,
uri: &'life1 str,
extra: RequestHandlerExtra,
) -> Pin<Box<dyn Future<Output = Result<ReadResourceResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Read a resource at the given URI.
Implementors§
impl ResourceHandler for ResourceCollection
Available on non-WebAssembly only.
impl<R, L> ResourceHandler for DynamicResourceHandler<R, L>
Available on non-WebAssembly only.