pub struct TenantConnectionGuard { /* private fields */ }Expand description
租户连接守卫(RAII)
Implementations§
Source§impl TenantConnectionGuard
impl TenantConnectionGuard
Sourcepub fn new(
binder: Arc<ConnectionTenantBinder>,
tenant_id: String,
connection_id: ConnectionId,
) -> Self
pub fn new( binder: Arc<ConnectionTenantBinder>, tenant_id: String, connection_id: ConnectionId, ) -> Self
创建守卫
Sourcepub fn connection_id(&self) -> ConnectionId
pub fn connection_id(&self) -> ConnectionId
获取连接 ID
Sourcepub fn clear_tenant_sql(&self) -> String
pub fn clear_tenant_sql(&self) -> String
获取清理 SQL
Sourcepub fn release(&mut self) -> Result<(), TenantError>
pub fn release(&mut self) -> Result<(), TenantError>
手动释放(提前清理)
Trait Implementations§
Source§impl Drop for TenantConnectionGuard
impl Drop for TenantConnectionGuard
Auto Trait Implementations§
impl !RefUnwindSafe for TenantConnectionGuard
impl !UnwindSafe for TenantConnectionGuard
impl Freeze for TenantConnectionGuard
impl Send for TenantConnectionGuard
impl Sync for TenantConnectionGuard
impl Unpin for TenantConnectionGuard
impl UnsafeUnpin for TenantConnectionGuard
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more