Trait yew_api_hook::Request

source ·
pub trait Request: Debug + PartialEq + Clone {
    type Error: Clone + Debug + PartialEq + 'static;
    type Output: Clone + Debug + PartialEq + 'static;

    fn run<'life0, 'async_trait>(
        &'life0 self
    ) -> Pin<Box<dyn Future<Output = Result<Self::Output, Self::Error>> + 'async_trait>>
    where
        Self: 'async_trait,
        'life0: 'async_trait
; fn store(_: Self::Output) { ... } }
Expand description

The core request trait which has to be implemented for all handler which can be executed through the use api hook.

Required Associated Types§

The error which can occur on request failure

The output type of a succesful request

Required Methods§

Run the asynchronous operation responsible for fetching or computing the requested data

Provided Methods§

Store or otherwise handle the data of a succesful run of the request E.g. Store the requested data in a yewdux store

Implementors§