ContextPlugin

Trait ContextPlugin 

Source
pub trait ContextPlugin:
    Send
    + Sync
    + 'static {
    // Required methods
    fn register_app<'life0, 'async_trait>(
        &'life0 self,
        request: Request<RegisterAppRequest>,
    ) -> Pin<Box<dyn Future<Output = Result<Response<RegisterAppResponse>, Status>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn unregister_app<'life0, 'async_trait>(
        &'life0 self,
        request: Request<UnregisterAppRequest>,
    ) -> Pin<Box<dyn Future<Output = Result<Response<UnregisterAppResponse>, Status>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn get_context<'life0, 'async_trait>(
        &'life0 self,
        request: Request<GetContextRequest>,
    ) -> Pin<Box<dyn Future<Output = Result<Response<AppContext>, Status>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

Generated trait containing gRPC methods that should be implemented for use with ContextPluginServer.

Required Methods§

Source

fn register_app<'life0, 'async_trait>( &'life0 self, request: Request<RegisterAppRequest>, ) -> Pin<Box<dyn Future<Output = Result<Response<RegisterAppResponse>, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

This method gets invoked whenever we install or change an app that has a permission this plugin cares about.

Source

fn unregister_app<'life0, 'async_trait>( &'life0 self, request: Request<UnregisterAppRequest>, ) -> Pin<Box<dyn Future<Output = Result<Response<UnregisterAppResponse>, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn get_context<'life0, 'async_trait>( &'life0 self, request: Request<GetContextRequest>, ) -> Pin<Box<dyn Future<Output = Result<Response<AppContext>, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

This method gets invoked whenever we need to render a template that uses this plugin.

Implementors§