pub struct ValkeyGILGuard<T> { /* private fields */ }
Expand description
This struct allows to guard some data and makes sure the data is only access when the Valkey GIL is locked. From example, assuming you module want to save some statistics inside some global variable, but without the need to protect this variable with some mutex (because we know this variable is protected by Valkey lock). For example, look at examples/threads.rs
Implementations§
Source§impl<T> ValkeyGILGuard<T>
impl<T> ValkeyGILGuard<T>
pub fn new(obj: T) -> ValkeyGILGuard<T>
pub fn lock<'mutex, 'ctx, G: ValkeyLockIndicator>( &'mutex self, context: &'ctx G, ) -> ValkeyGILGuardScope<'ctx, 'mutex, T, G>
Trait Implementations§
Source§impl<T: Clone> ConfigurationValue<T> for ValkeyGILGuard<T>
impl<T: Clone> ConfigurationValue<T> for ValkeyGILGuard<T>
fn get(&self, ctx: &ConfigurationContext) -> T
fn set(&self, ctx: &ConfigurationContext, val: T) -> Result<(), ValkeyError>
Source§impl ConfigurationValue<ValkeyString> for ValkeyGILGuard<String>
impl ConfigurationValue<ValkeyString> for ValkeyGILGuard<String>
fn get(&self, ctx: &ConfigurationContext) -> ValkeyString
fn set( &self, ctx: &ConfigurationContext, val: ValkeyString, ) -> Result<(), ValkeyError>
Source§impl<T: Default> Default for ValkeyGILGuard<T>
impl<T: Default> Default for ValkeyGILGuard<T>
impl<T> Send for ValkeyGILGuard<T>
impl<T> Sync for ValkeyGILGuard<T>
Auto Trait Implementations§
impl<T> !Freeze for ValkeyGILGuard<T>
impl<T> !RefUnwindSafe for ValkeyGILGuard<T>
impl<T> Unpin for ValkeyGILGuard<T>where
T: Unpin,
impl<T> UnwindSafe for ValkeyGILGuard<T>where
T: 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