#[non_exhaustive]pub struct TenantContext {
pub tenant_id: String,
}Expand description
Represents an active tenant selected by trusted authentication middleware.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.tenant_id: StringThe unique identifier of the tenant or organization.
Implementations§
Source§impl TenantContext
impl TenantContext
Sourcepub fn try_new(tenant_id: impl Into<String>) -> Result<Self, TenantContextError>
pub fn try_new(tenant_id: impl Into<String>) -> Result<Self, TenantContextError>
Creates a validated TenantContext from a trusted identity claim.
Identifiers are 1 to 128 bytes of ASCII letters, digits, -, _, .
and :, and must not consist only of dots.
Trait Implementations§
Source§impl Clone for TenantContext
impl Clone for TenantContext
Source§impl Debug for TenantContext
impl Debug for TenantContext
impl Eq for TenantContext
Source§impl PartialEq for TenantContext
impl PartialEq for TenantContext
impl StructuralPartialEq for TenantContext
Auto Trait Implementations§
impl Freeze for TenantContext
impl RefUnwindSafe for TenantContext
impl Send for TenantContext
impl Sync for TenantContext
impl Unpin for TenantContext
impl UnsafeUnpin for TenantContext
impl UnwindSafe for TenantContext
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