pub enum IsolationStrategy {
RowLevel(RowLevelConfig),
Schema(SchemaConfig),
Database(DatabaseConfig),
Hybrid(Box<IsolationStrategy>, Box<IsolationStrategy>),
}Expand description
The isolation strategy for multi-tenancy.
Variants§
RowLevel(RowLevelConfig)
Row-level security: all tenants share tables, filtered by column.
Schema(SchemaConfig)
Schema-based: each tenant has their own schema.
Database(DatabaseConfig)
Database-based: each tenant has their own database.
Hybrid(Box<IsolationStrategy>, Box<IsolationStrategy>)
Hybrid: combination of strategies (e.g., schema + row-level).
Implementations§
Source§impl IsolationStrategy
impl IsolationStrategy
Sourcepub fn schema_based() -> Self
pub fn schema_based() -> Self
Create a schema-based isolation strategy.
Sourcepub fn database_based() -> Self
pub fn database_based() -> Self
Create a database-based isolation strategy.
Sourcepub fn is_row_level(&self) -> bool
pub fn is_row_level(&self) -> bool
Check if this is row-level isolation.
Sourcepub fn is_schema_based(&self) -> bool
pub fn is_schema_based(&self) -> bool
Check if this is schema-based isolation.
Sourcepub fn is_database_based(&self) -> bool
pub fn is_database_based(&self) -> bool
Check if this is database-based isolation.
Sourcepub fn row_level_config(&self) -> Option<&RowLevelConfig>
pub fn row_level_config(&self) -> Option<&RowLevelConfig>
Get the row-level config if applicable.
Sourcepub fn schema_config(&self) -> Option<&SchemaConfig>
pub fn schema_config(&self) -> Option<&SchemaConfig>
Get the schema config if applicable.
Sourcepub fn database_config(&self) -> Option<&DatabaseConfig>
pub fn database_config(&self) -> Option<&DatabaseConfig>
Get the database config if applicable.
Trait Implementations§
Source§impl Clone for IsolationStrategy
impl Clone for IsolationStrategy
Source§fn clone(&self) -> IsolationStrategy
fn clone(&self) -> IsolationStrategy
Returns a duplicate of the value. Read more
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for IsolationStrategy
impl RefUnwindSafe for IsolationStrategy
impl Send for IsolationStrategy
impl Sync for IsolationStrategy
impl Unpin for IsolationStrategy
impl UnwindSafe for IsolationStrategy
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)