pub trait ResourceHandler:
Send
+ Sync
+ 'static {
// Required methods
fn list(
&self,
) -> Pin<Box<dyn Future<Output = Vec<ResourceDef>> + Send + '_>>;
fn read(
&self,
uri: &str,
) -> Pin<Box<dyn Future<Output = Result<ResourceContentDef, String>> + Send + '_>>;
fn subscribe(
&self,
uri: &str,
) -> Pin<Box<dyn Future<Output = Result<Receiver<ResourceContentDef>, String>> + Send + '_>>;
}Expand description
Resource handler trait
Implement this trait to handle resource operations.
Required Methods§
Sourcefn list(&self) -> Pin<Box<dyn Future<Output = Vec<ResourceDef>> + Send + '_>>
fn list(&self) -> Pin<Box<dyn Future<Output = Vec<ResourceDef>> + Send + '_>>
List available resources