pub struct TenantScope;Expand description
多租户全局作用域
自动追加 AND tenant_id = ? 到所有查询,绑定 ctx.tenant_id。
若 ctx.tenant_id 为 None,则不追加条件(允许跨租户查询,需调用方自行保证安全)。
Auto Trait Implementations§
impl Freeze for TenantScope
impl RefUnwindSafe for TenantScope
impl Send for TenantScope
impl Sync for TenantScope
impl Unpin for TenantScope
impl UnsafeUnpin for TenantScope
impl UnwindSafe for TenantScope
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