pub struct TenantConfigBuilder { /* private fields */ }Expand description
Builder for advanced tenant configuration.
Implementations§
Source§impl TenantConfigBuilder
impl TenantConfigBuilder
Sourcepub fn strategy(self, strategy: IsolationStrategy) -> Self
pub fn strategy(self, strategy: IsolationStrategy) -> Self
Set the isolation strategy.
Sourcepub fn row_level(self, config: RowLevelConfig) -> Self
pub fn row_level(self, config: RowLevelConfig) -> Self
Use row-level isolation.
Sourcepub fn schema(self, config: SchemaConfig) -> Self
pub fn schema(self, config: SchemaConfig) -> Self
Use schema-based isolation.
Sourcepub fn database(self, config: DatabaseConfig) -> Self
pub fn database(self, config: DatabaseConfig) -> Self
Use database-based isolation.
Sourcepub fn require_tenant(self, require: bool) -> Self
pub fn require_tenant(self, require: bool) -> Self
Require tenant context.
Sourcepub fn default_tenant(self, tenant: impl Into<String>) -> Self
pub fn default_tenant(self, tenant: impl Into<String>) -> Self
Set the default tenant.
Sourcepub fn allow_bypass(self, allow: bool) -> Self
pub fn allow_bypass(self, allow: bool) -> Self
Allow bypass for superusers.
Sourcepub fn resolver<R: TenantResolver + 'static>(self, resolver: R) -> Self
pub fn resolver<R: TenantResolver + 'static>(self, resolver: R) -> Self
Set the tenant resolver.
Sourcepub fn enforce_on_writes(self, enforce: bool) -> Self
pub fn enforce_on_writes(self, enforce: bool) -> Self
Enforce tenant on writes.
Sourcepub fn log_context(self, log: bool) -> Self
pub fn log_context(self, log: bool) -> Self
Enable tenant context logging.
Sourcepub fn build(self) -> TenantConfig
pub fn build(self) -> TenantConfig
Build the config.
Trait Implementations§
Source§impl Default for TenantConfigBuilder
impl Default for TenantConfigBuilder
Source§fn default() -> TenantConfigBuilder
fn default() -> TenantConfigBuilder
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for TenantConfigBuilder
impl !RefUnwindSafe for TenantConfigBuilder
impl Send for TenantConfigBuilder
impl Sync for TenantConfigBuilder
impl Unpin for TenantConfigBuilder
impl !UnwindSafe for TenantConfigBuilder
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