Skip to main content

Tenancy

Struct Tenancy 

Source
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<'_>

Source

pub fn whoami(&self) -> Result<WhoAmI>

Source

pub fn list_tenants(&self) -> Result<Vec<Tenant>>

Source

pub fn create_tenant(&self, id: &str, name: Option<&str>) -> Result<Tenant>

Source

pub fn disable_tenant(&self, id: &str) -> Result<Tenant>

Source

pub fn enable_tenant(&self, id: &str) -> Result<Tenant>

Source

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.

Source

pub fn list_keys(&self) -> Result<Vec<ApiKeyInfo>>

Source

pub fn create_key(&self, name: &str, role: TenantRole) -> Result<NewApiKey>

Source

pub fn revoke_key(&self, id: &str) -> Result<()>

Source

pub fn list_members(&self) -> Result<Vec<TenantMember>>

Source

pub fn set_member( &self, subject: &str, role: TenantRole, ) -> Result<TenantMember>

Source

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.