pub struct DetachedContext { /* private fields */ }
Expand description
This struct allows logging when the Valkey GIL is not acquired.
It is implemented Send
and Sync
so it can safely be used
from within different threads.
Implementations§
Source§impl DetachedContext
impl DetachedContext
pub fn log(&self, level: ValkeyLogLevel, message: &str)
pub fn log_debug(&self, message: &str)
pub fn log_notice(&self, message: &str)
pub fn log_verbose(&self, message: &str)
pub fn log_warning(&self, message: &str)
pub fn set_context(&self, ctx: &Context) -> Result<(), ValkeyError>
Sourcepub fn lock(&self) -> DetachedContextGuard
pub fn lock(&self) -> DetachedContextGuard
Lock Valkey for command invocation. Returns DetachedContextGuard which will unlock Valkey when dispose. DetachedContextGuard implements [Deref<Target = Context>] so it can be used just like any Valkey Context for command invocation. Locking Valkey when Valkey is already locked by the current thread is left unspecified. However, this function will not return on the second call (it might panic or deadlock, for example)..
Trait Implementations§
Source§impl Default for DetachedContext
impl Default for DetachedContext
impl Send for DetachedContext
impl Sync for DetachedContext
Auto Trait Implementations§
impl !Freeze for DetachedContext
impl RefUnwindSafe for DetachedContext
impl Unpin for DetachedContext
impl UnwindSafe for DetachedContext
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