Skip to main content

HasTenant

Trait HasTenant 

Source
pub trait HasTenant {
    // Required method
    fn tenant(&self) -> &TenantContext;

    // Provided methods
    fn tenant_id(&self) -> Option<Uuid> { ... }
    fn require_tenant(&self) -> Result<Uuid> { ... }
}
Expand description

Trait for contexts that have tenant information.

Required Methods§

Source

fn tenant(&self) -> &TenantContext

Get the tenant context.

Provided Methods§

Source

fn tenant_id(&self) -> Option<Uuid>

Get the tenant ID if set.

Source

fn require_tenant(&self) -> Result<Uuid>

Require a tenant ID.

Implementors§