Trait autoendpoint::routers::Router

source ·
pub trait Router {
    // Required methods
    fn register(
        &self,
        router_input: &RouterDataInput,
        app_id: &str,
    ) -> Result<HashMap<String, Value>, RouterError>;
    fn route_notification<'life0, 'life1, 'async_trait>(
        &'life0 self,
        notification: &'life1 Notification,
    ) -> Pin<Box<dyn Future<Output = Result<RouterResponse, ApiError>> + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}

Required Methods§

source

fn register( &self, router_input: &RouterDataInput, app_id: &str, ) -> Result<HashMap<String, Value>, RouterError>

Validate that the user can use this router, and return data to be stored in the user’s router_data field.

source

fn route_notification<'life0, 'life1, 'async_trait>( &'life0 self, notification: &'life1 Notification, ) -> Pin<Box<dyn Future<Output = Result<RouterResponse, ApiError>> + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Route a notification to the user

Implementors§