pub struct ThreadSafeContext<B: Send> { /* private fields */ }
Implementations§
Source§impl ThreadSafeContext<BlockedClient>
impl ThreadSafeContext<BlockedClient>
pub fn with_blocked_client(blocked_client: BlockedClient) -> Self
Sourcepub fn reply(&self, r: RedisResult) -> Status
pub fn reply(&self, r: RedisResult) -> Status
The Redis modules API does not require locking for Reply
functions,
so we pass through its functionality directly.
Source§impl<B: Send> ThreadSafeContext<B>
impl<B: Send> ThreadSafeContext<B>
Sourcepub fn lock(&self) -> ContextGuard
pub fn lock(&self) -> ContextGuard
All other APIs require locking the context, so we wrap it in a way
similar to std::sync::Mutex
.
Trait Implementations§
Source§impl<B: Send> Drop for ThreadSafeContext<B>
impl<B: Send> Drop for ThreadSafeContext<B>
impl<B: Send> Send for ThreadSafeContext<B>
impl<B: Send> Sync for ThreadSafeContext<B>
Auto Trait Implementations§
impl<B> Freeze for ThreadSafeContext<B>where
B: Freeze,
impl<B> RefUnwindSafe for ThreadSafeContext<B>where
B: RefUnwindSafe,
impl<B> Unpin for ThreadSafeContext<B>where
B: Unpin,
impl<B> UnwindSafe for ThreadSafeContext<B>where
B: UnwindSafe,
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