Skip to main content

TnIdResolver

Trait TnIdResolver 

Source
pub trait TnIdResolver: Send + Sync {
    // Required method
    fn resolve_tn_id<'life0, 'life1, 'async_trait>(
        &'life0 self,
        id_tag: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<TnId, Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}
Expand description

Trait for resolving TnId from an identity tag string.

Implement this on your application state type to enable the TnId Axum extractor.

Required Methods§

Source

fn resolve_tn_id<'life0, 'life1, 'async_trait>( &'life0 self, id_tag: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<TnId, Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Implementations on Foreign Types§

Source§

impl<T: TnIdResolver> TnIdResolver for Arc<T>

Blanket impl for Arc<T> so that App = Arc<AppState> works when AppState implements TnIdResolver.

Source§

fn resolve_tn_id<'life0, 'life1, 'async_trait>( &'life0 self, id_tag: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<TnId, Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Implementors§