pub struct Tenancy<'a>(/* private fields */);Expand description
Who am I, tenants and this tenant’s keys and members (see docs/en/multi-tenant.md).
Implementations§
Source§impl Tenancy<'_>
impl Tenancy<'_>
pub fn whoami(&self) -> Result<WhoAmI>
pub fn list_tenants(&self) -> Result<Vec<Tenant>>
pub fn create_tenant(&self, id: &str, name: Option<&str>) -> Result<Tenant>
pub fn disable_tenant(&self, id: &str) -> Result<Tenant>
pub fn enable_tenant(&self, id: &str) -> Result<Tenant>
Sourcepub fn create_tenant_key(
&self,
tenant: &str,
name: &str,
role: TenantRole,
) -> Result<NewApiKey>
pub fn create_tenant_key( &self, tenant: &str, name: &str, role: TenantRole, ) -> Result<NewApiKey>
A key in any tenant (platform admins); the plaintext key is returned once.
pub fn list_keys(&self) -> Result<Vec<ApiKeyInfo>>
pub fn create_key(&self, name: &str, role: TenantRole) -> Result<NewApiKey>
pub fn revoke_key(&self, id: &str) -> Result<()>
pub fn list_members(&self) -> Result<Vec<TenantMember>>
pub fn set_member( &self, subject: &str, role: TenantRole, ) -> Result<TenantMember>
pub fn remove_member(&self, subject: &str) -> Result<()>
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for Tenancy<'a>
impl<'a> !UnwindSafe for Tenancy<'a>
impl<'a> Freeze for Tenancy<'a>
impl<'a> Send for Tenancy<'a>
impl<'a> Sync for Tenancy<'a>
impl<'a> Unpin for Tenancy<'a>
impl<'a> UnsafeUnpin for Tenancy<'a>
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