ResourceHandler

Trait ResourceHandler 

Source
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§

Source

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,

Read resource content

Provided Methods§

Source

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)

Source

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,

Subscribe to resource changes (if supported)

Implementors§