pub struct TenantContext {
pub id: TenantId,
pub info: TenantInfo,
}Expand description
Context for the current tenant.
This context is passed through the query pipeline to ensure all operations are scoped to the correct tenant.
Fields§
§id: TenantIdThe tenant identifier.
info: TenantInfoAdditional tenant information.
Implementations§
Source§impl TenantContext
impl TenantContext
Sourcepub fn with_info(id: impl Into<TenantId>, info: TenantInfo) -> Self
pub fn with_info(id: impl Into<TenantId>, info: TenantInfo) -> Self
Create a tenant context with additional info.
Sourcepub fn should_bypass(&self) -> bool
pub fn should_bypass(&self) -> bool
Check if this context should bypass tenant filters.
Trait Implementations§
Source§impl Clone for TenantContext
impl Clone for TenantContext
Source§fn clone(&self) -> TenantContext
fn clone(&self) -> TenantContext
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for TenantContext
impl !RefUnwindSafe for TenantContext
impl Send for TenantContext
impl Sync for TenantContext
impl Unpin 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