pub struct IsolationRouter { /* private fields */ }Expand description
Isolation router that manages routing for all tenants
Implementations§
Source§impl IsolationRouter
impl IsolationRouter
Sourcepub fn with_default_handler(self, handler: Arc<dyn IsolationHandler>) -> Self
pub fn with_default_handler(self, handler: Arc<dyn IsolationHandler>) -> Self
Set the default handler
Sourcepub fn register_tenant(
&self,
tenant: TenantId,
handler: Arc<dyn IsolationHandler>,
)
pub fn register_tenant( &self, tenant: TenantId, handler: Arc<dyn IsolationHandler>, )
Register a handler for a tenant
Sourcepub fn register_from_config(&self, config: &TenantConfig)
pub fn register_from_config(&self, config: &TenantConfig)
Register handler based on tenant config
Sourcepub fn get_routing(
&self,
tenant: &TenantId,
config: &TenantConfig,
) -> RoutingDecision
pub fn get_routing( &self, tenant: &TenantId, config: &TenantConfig, ) -> RoutingDecision
Get routing decision for tenant
Sourcepub fn can_access_table(
&self,
tenant: &TenantId,
table: &str,
config: &TenantConfig,
) -> bool
pub fn can_access_table( &self, tenant: &TenantId, table: &str, config: &TenantConfig, ) -> bool
Check if tenant can access a table
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for IsolationRouter
impl !RefUnwindSafe for IsolationRouter
impl Send for IsolationRouter
impl Sync for IsolationRouter
impl Unpin for IsolationRouter
impl UnsafeUnpin for IsolationRouter
impl !UnwindSafe for IsolationRouter
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more