pub struct TenantManager { /* private fields */ }Expand description
Multi-tenant data manager
Implementations§
Source§impl TenantManager
impl TenantManager
Sourcepub fn with_max_audit_entries(self, max: usize) -> Self
pub fn with_max_audit_entries(self, max: usize) -> Self
Set maximum audit log entries
Sourcepub fn with_quota_enforcement(self, enforce: bool) -> Self
pub fn with_quota_enforcement(self, enforce: bool) -> Self
Enable or disable quota enforcement
Sourcepub fn register_tenant(&mut self, config: TenantConfig) -> Result<()>
pub fn register_tenant(&mut self, config: TenantConfig) -> Result<()>
Register a new tenant
Sourcepub fn remove_tenant(&mut self, tenant_id: &str) -> Result<()>
pub fn remove_tenant(&mut self, tenant_id: &str) -> Result<()>
Remove a tenant and all their data
Sourcepub fn get_tenant(&self, tenant_id: &str) -> Option<&TenantConfig>
pub fn get_tenant(&self, tenant_id: &str) -> Option<&TenantConfig>
Get tenant configuration
Sourcepub fn update_tenant(&mut self, config: TenantConfig) -> Result<()>
pub fn update_tenant(&mut self, config: TenantConfig) -> Result<()>
Update tenant configuration
Sourcepub fn list_tenants(&self) -> Vec<&TenantId> ⓘ
pub fn list_tenants(&self) -> Vec<&TenantId> ⓘ
List all tenant IDs
Sourcepub fn has_permission(&self, tenant_id: &str, permission: Permission) -> bool
pub fn has_permission(&self, tenant_id: &str, permission: Permission) -> bool
Check if tenant has a specific permission
Sourcepub fn store_dataframe(
&mut self,
tenant_id: &str,
dataset_id: &str,
df: DataFrame,
) -> Result<()>
pub fn store_dataframe( &mut self, tenant_id: &str, dataset_id: &str, df: DataFrame, ) -> Result<()>
Store a DataFrame for a tenant
Sourcepub fn get_dataframe(
&mut self,
tenant_id: &str,
dataset_id: &str,
) -> Result<DataFrame>
pub fn get_dataframe( &mut self, tenant_id: &str, dataset_id: &str, ) -> Result<DataFrame>
Get a DataFrame for a tenant (cloned)
Sourcepub fn delete_dataframe(
&mut self,
tenant_id: &str,
dataset_id: &str,
) -> Result<()>
pub fn delete_dataframe( &mut self, tenant_id: &str, dataset_id: &str, ) -> Result<()>
Delete a dataset for a tenant
Sourcepub fn list_datasets(&self, tenant_id: &str) -> Result<Vec<&DatasetMetadata>>
pub fn list_datasets(&self, tenant_id: &str) -> Result<Vec<&DatasetMetadata>>
List datasets for a tenant
Sourcepub fn get_dataset_metadata(
&self,
tenant_id: &str,
dataset_id: &str,
) -> Result<&DatasetMetadata>
pub fn get_dataset_metadata( &self, tenant_id: &str, dataset_id: &str, ) -> Result<&DatasetMetadata>
Get dataset metadata
Share a dataset with another tenant
Sourcepub fn get_usage(&self, tenant_id: &str) -> Result<&TenantUsage>
pub fn get_usage(&self, tenant_id: &str) -> Result<&TenantUsage>
Get tenant usage statistics
Sourcepub fn get_audit_log(&self, tenant_id: Option<&str>) -> Vec<&TenantAuditEntry>
pub fn get_audit_log(&self, tenant_id: Option<&str>) -> Vec<&TenantAuditEntry>
Get audit log for a tenant
Trait Implementations§
Source§impl Debug for TenantManager
impl Debug for TenantManager
Auto Trait Implementations§
impl Freeze for TenantManager
impl RefUnwindSafe for TenantManager
impl Send for TenantManager
impl Sync for TenantManager
impl Unpin for TenantManager
impl UnwindSafe for TenantManager
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