Trait SpiBsInstExtractor

Source
pub trait SpiBsInstExtractor {
    // Required methods
    fn init<'a, 'life0, 'async_trait, F, T>(
        &'life0 self,
        custom_cache_key: Option<String>,
        ctx: &'a TardisContext,
        mgr: bool,
        init_funs: F,
    ) -> Pin<Box<dyn Future<Output = TardisResult<Arc<SpiBsInst>>> + Send + 'async_trait>>
       where F: Fn(SpiBsCertResp, &'a TardisContext, bool) -> T + Send + Sync + 'async_trait,
             T: Future<Output = TardisResult<SpiBsInst>> + Send + 'async_trait,
             Self: 'async_trait,
             'a: 'async_trait,
             'life0: 'async_trait;
    fn bs<'a, 'life0, 'async_trait>(
        &'life0 self,
        ctx: &'a TardisContext,
    ) -> Pin<Box<dyn Future<Output = TardisResult<Arc<SpiBsInst>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'a: 'async_trait,
             'life0: 'async_trait;
    fn init_bs<'a, 'life0, 'async_trait, F, T>(
        &'life0 self,
        ctx: &'a TardisContext,
        mgr: bool,
        init_funs: F,
    ) -> Pin<Box<dyn Future<Output = TardisResult<Arc<SpiBsInst>>> + Send + 'async_trait>>
       where F: Fn(SpiBsCertResp, &'a TardisContext, bool) -> T + Send + Sync + 'async_trait,
             T: Future<Output = TardisResult<SpiBsInst>> + Send + 'async_trait,
             Self: 'async_trait,
             'a: 'async_trait,
             'life0: 'async_trait;
    fn bs_not_implemented(&self, bs_code: &str) -> TardisError;
    fn remove_bs_inst_cache<'a, 'life0, 'async_trait>(
        &'life0 self,
        ctx: &'a TardisContext,
    ) -> Pin<Box<dyn Future<Output = TardisResult<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'a: 'async_trait,
             'life0: 'async_trait;
}

Required Methods§

Source

fn init<'a, 'life0, 'async_trait, F, T>( &'life0 self, custom_cache_key: Option<String>, ctx: &'a TardisContext, mgr: bool, init_funs: F, ) -> Pin<Box<dyn Future<Output = TardisResult<Arc<SpiBsInst>>> + Send + 'async_trait>>
where F: Fn(SpiBsCertResp, &'a TardisContext, bool) -> T + Send + Sync + 'async_trait, T: Future<Output = TardisResult<SpiBsInst>> + Send + 'async_trait, Self: 'async_trait, 'a: 'async_trait, 'life0: 'async_trait,

Source

fn bs<'a, 'life0, 'async_trait>( &'life0 self, ctx: &'a TardisContext, ) -> Pin<Box<dyn Future<Output = TardisResult<Arc<SpiBsInst>>> + Send + 'async_trait>>
where Self: 'async_trait, 'a: 'async_trait, 'life0: 'async_trait,

Source

fn init_bs<'a, 'life0, 'async_trait, F, T>( &'life0 self, ctx: &'a TardisContext, mgr: bool, init_funs: F, ) -> Pin<Box<dyn Future<Output = TardisResult<Arc<SpiBsInst>>> + Send + 'async_trait>>
where F: Fn(SpiBsCertResp, &'a TardisContext, bool) -> T + Send + Sync + 'async_trait, T: Future<Output = TardisResult<SpiBsInst>> + Send + 'async_trait, Self: 'async_trait, 'a: 'async_trait, 'life0: 'async_trait,

Source

fn bs_not_implemented(&self, bs_code: &str) -> TardisError

Source

fn remove_bs_inst_cache<'a, 'life0, 'async_trait>( &'life0 self, ctx: &'a TardisContext, ) -> Pin<Box<dyn Future<Output = TardisResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'a: 'async_trait, 'life0: 'async_trait,

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl SpiBsInstExtractor for TardisFunsInst

Source§

fn init<'a, 'life0, 'async_trait, F, T>( &'life0 self, custom_cache_key: Option<String>, ctx: &'a TardisContext, mgr: bool, init_fun: F, ) -> Pin<Box<dyn Future<Output = TardisResult<Arc<SpiBsInst>>> + Send + 'async_trait>>
where F: Fn(SpiBsCertResp, &'a TardisContext, bool) -> T + Send + Sync + 'async_trait, T: Future<Output = TardisResult<SpiBsInst>> + Send + 'async_trait, Self: 'async_trait, 'a: 'async_trait, 'life0: 'async_trait,

Initialize the backend service instance

§Arguments
  • custom_cache_key - Customize the cache key, if it is none, the default cache key will be used.
  • ctx - Request Context
  • mgr - Whether it is a managed request
  • init_fun - The initialization function called when the backend service instance is not initialized
§Return

the backend service instance kind

Source§

fn bs<'a, 'life0, 'async_trait>( &'life0 self, ctx: &'a TardisContext, ) -> Pin<Box<dyn Future<Output = TardisResult<Arc<SpiBsInst>>> + Send + 'async_trait>>
where Self: 'async_trait, 'a: 'async_trait, 'life0: 'async_trait,

Fetch the backend service instance

§Arguments
  • ctx - Request Context
§Return

the backend service instance

Source§

fn init_bs<'a, 'life0, 'async_trait, F, T>( &'life0 self, ctx: &'a TardisContext, mgr: bool, init_fun: F, ) -> Pin<Box<dyn Future<Output = TardisResult<Arc<SpiBsInst>>> + Send + 'async_trait>>
where F: Fn(SpiBsCertResp, &'a TardisContext, bool) -> T + Send + Sync + 'async_trait, T: Future<Output = TardisResult<SpiBsInst>> + Send + 'async_trait, Self: 'async_trait, 'a: 'async_trait, 'life0: 'async_trait,

Initialize the backend service instance and fetch it

§Arguments
  • ctx - Request Context
  • mgr - Whether it is a managed request
  • init_fun - The initialization function called when the backend service instance is not initialized
§Return

the backend service instance

Source§

fn bs_not_implemented(&self, bs_code: &str) -> TardisError

Source§

fn remove_bs_inst_cache<'a, 'life0, 'async_trait>( &'life0 self, ctx: &'a TardisContext, ) -> Pin<Box<dyn Future<Output = TardisResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'a: 'async_trait, 'life0: 'async_trait,

Implementors§