pub trait ResourceHandler: Send + Sync {
// Required method
fn read<'life0, 'life1, 'async_trait>(
&'life0 self,
uri: &'life1 str,
params: FxHashMap<String, String>,
) -> Pin<Box<dyn Future<Output = Result<Vec<u8>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
// Provided methods
fn write<'life0, 'life1, 'async_trait>(
&'life0 self,
uri: &'life1 str,
params: FxHashMap<String, String>,
content: Vec<u8>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait { ... }
fn subscribe<'life0, 'life1, 'async_trait>(
&'life0 self,
uri: &'life1 str,
params: FxHashMap<String, String>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait { ... }
}Expand description
Resource handler trait for read/write/subscribe operations
Required Methods§
Provided Methods§
Sourcefn write<'life0, 'life1, 'async_trait>(
&'life0 self,
uri: &'life1 str,
params: FxHashMap<String, String>,
content: Vec<u8>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn write<'life0, 'life1, 'async_trait>(
&'life0 self,
uri: &'life1 str,
params: FxHashMap<String, String>,
content: Vec<u8>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Write resource content (if supported)