pub struct TenantManager { /* private fields */ }Expand description
Tenant manager - manages all tenants and their resources
Implementations§
Source§impl TenantManager
impl TenantManager
Sourcepub fn create_tenant(
&self,
id: String,
name: String,
quotas: Option<ResourceQuotas>,
) -> TenantResult<()>
pub fn create_tenant( &self, id: String, name: String, quotas: Option<ResourceQuotas>, ) -> TenantResult<()>
Create a new tenant
Sourcepub fn delete_tenant(&self, id: &str) -> TenantResult<()>
pub fn delete_tenant(&self, id: &str) -> TenantResult<()>
Delete a tenant
Sourcepub fn get_tenant(&self, id: &str) -> TenantResult<Tenant>
pub fn get_tenant(&self, id: &str) -> TenantResult<Tenant>
Get tenant information
Sourcepub fn list_tenants(&self) -> Vec<Tenant>
pub fn list_tenants(&self) -> Vec<Tenant>
List all tenants
Sourcepub fn is_tenant_enabled(&self, id: &str) -> bool
pub fn is_tenant_enabled(&self, id: &str) -> bool
Check if a tenant exists and is enabled
Sourcepub fn check_quota(&self, tenant_id: &str, resource: &str) -> TenantResult<()>
pub fn check_quota(&self, tenant_id: &str, resource: &str) -> TenantResult<()>
Check and enforce resource quota
Sourcepub fn increment_usage(
&self,
tenant_id: &str,
resource: &str,
amount: usize,
) -> TenantResult<()>
pub fn increment_usage( &self, tenant_id: &str, resource: &str, amount: usize, ) -> TenantResult<()>
Increment resource usage
Sourcepub fn decrement_usage(
&self,
tenant_id: &str,
resource: &str,
amount: usize,
) -> TenantResult<()>
pub fn decrement_usage( &self, tenant_id: &str, resource: &str, amount: usize, ) -> TenantResult<()>
Decrement resource usage
Sourcepub fn get_usage(&self, tenant_id: &str) -> TenantResult<ResourceUsage>
pub fn get_usage(&self, tenant_id: &str) -> TenantResult<ResourceUsage>
Get resource usage for a tenant
Sourcepub fn update_quotas(
&self,
tenant_id: &str,
quotas: ResourceQuotas,
) -> TenantResult<()>
pub fn update_quotas( &self, tenant_id: &str, quotas: ResourceQuotas, ) -> TenantResult<()>
Update tenant quotas
Sourcepub fn update_embed_config(
&self,
tenant_id: &str,
config: Option<AutoEmbedConfig>,
) -> TenantResult<()>
pub fn update_embed_config( &self, tenant_id: &str, config: Option<AutoEmbedConfig>, ) -> TenantResult<()>
Update Auto-Embed configuration for a tenant
Sourcepub fn update_nlq_config(
&self,
tenant_id: &str,
config: Option<NLQConfig>,
) -> TenantResult<()>
pub fn update_nlq_config( &self, tenant_id: &str, config: Option<NLQConfig>, ) -> TenantResult<()>
Update NLQ configuration for a tenant
Sourcepub fn update_agent_config(
&self,
tenant_id: &str,
config: Option<AgentConfig>,
) -> TenantResult<()>
pub fn update_agent_config( &self, tenant_id: &str, config: Option<AgentConfig>, ) -> TenantResult<()>
Update Agent configuration for a tenant
Sourcepub fn set_enabled(&self, tenant_id: &str, enabled: bool) -> TenantResult<()>
pub fn set_enabled(&self, tenant_id: &str, enabled: bool) -> TenantResult<()>
Enable/disable a tenant
Trait Implementations§
Auto Trait Implementations§
impl Freeze for TenantManager
impl RefUnwindSafe for TenantManager
impl Send for TenantManager
impl Sync for TenantManager
impl Unpin for TenantManager
impl UnsafeUnpin 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> 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