pub struct CompositeResolver { /* private fields */ }Expand description
A composite resolver that tries multiple resolvers in order.
Implementations§
Source§impl CompositeResolver
impl CompositeResolver
Sourcepub fn add<R: TenantResolver + 'static>(self, resolver: R) -> Self
pub fn add<R: TenantResolver + 'static>(self, resolver: R) -> Self
Add a resolver to the chain.
Trait Implementations§
Source§impl Debug for CompositeResolver
impl Debug for CompositeResolver
Source§impl Default for CompositeResolver
impl Default for CompositeResolver
Source§impl TenantResolver for CompositeResolver
impl TenantResolver for CompositeResolver
Source§fn resolve<'life0, 'life1, 'async_trait>(
&'life0 self,
tenant_id: &'life1 TenantId,
) -> Pin<Box<dyn Future<Output = QueryResult<TenantContext>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn resolve<'life0, 'life1, 'async_trait>(
&'life0 self,
tenant_id: &'life1 TenantId,
) -> Pin<Box<dyn Future<Output = QueryResult<TenantContext>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Resolve a tenant ID to a full tenant context.
Source§fn validate<'life0, 'life1, 'async_trait>(
&'life0 self,
tenant_id: &'life1 TenantId,
) -> Pin<Box<dyn Future<Output = QueryResult<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn validate<'life0, 'life1, 'async_trait>(
&'life0 self,
tenant_id: &'life1 TenantId,
) -> Pin<Box<dyn Future<Output = QueryResult<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Validate that a tenant exists and is active.
Source§fn schema_for<'life0, 'life1, 'async_trait>(
&'life0 self,
tenant_id: &'life1 TenantId,
) -> Pin<Box<dyn Future<Output = QueryResult<Option<String>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn schema_for<'life0, 'life1, 'async_trait>(
&'life0 self,
tenant_id: &'life1 TenantId,
) -> Pin<Box<dyn Future<Output = QueryResult<Option<String>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Get the schema name for a tenant (schema-based isolation).
Source§fn database_for<'life0, 'life1, 'async_trait>(
&'life0 self,
tenant_id: &'life1 TenantId,
) -> Pin<Box<dyn Future<Output = QueryResult<Option<String>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn database_for<'life0, 'life1, 'async_trait>(
&'life0 self,
tenant_id: &'life1 TenantId,
) -> Pin<Box<dyn Future<Output = QueryResult<Option<String>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Get the database name for a tenant (database-based isolation).
Auto Trait Implementations§
impl Freeze for CompositeResolver
impl !RefUnwindSafe for CompositeResolver
impl Send for CompositeResolver
impl Sync for CompositeResolver
impl Unpin for CompositeResolver
impl !UnwindSafe for CompositeResolver
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more