pub struct RedisGILGuard<T> { /* private fields */ }
Expand description
This struct allows to guard some data and makes sure the data is only access when the Redis 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 Redis lock). For example, look at examples/threads.rs
Implementations§
Source§impl<T> RedisGILGuard<T>
impl<T> RedisGILGuard<T>
pub fn new(obj: T) -> RedisGILGuard<T>
pub fn lock<'mutex, 'ctx, G: RedisLockIndicator>( &'mutex self, context: &'ctx G, ) -> RedisGILGuardScope<'ctx, 'mutex, T, G>
Trait Implementations§
Source§impl ConfigurationValue<RedisString> for RedisGILGuard<String>
impl ConfigurationValue<RedisString> for RedisGILGuard<String>
fn get(&self, ctx: &ConfigurationContext) -> RedisString
fn set( &self, ctx: &ConfigurationContext, val: RedisString, ) -> Result<(), RedisError>
Source§impl<T: Clone> ConfigurationValue<T> for RedisGILGuard<T>
impl<T: Clone> ConfigurationValue<T> for RedisGILGuard<T>
fn get(&self, ctx: &ConfigurationContext) -> T
fn set(&self, ctx: &ConfigurationContext, val: T) -> Result<(), RedisError>
Source§impl<T: Default> Default for RedisGILGuard<T>
impl<T: Default> Default for RedisGILGuard<T>
impl<T> Send for RedisGILGuard<T>
impl<T> Sync for RedisGILGuard<T>
Auto Trait Implementations§
impl<T> !Freeze for RedisGILGuard<T>
impl<T> !RefUnwindSafe for RedisGILGuard<T>
impl<T> Unpin for RedisGILGuard<T>where
T: Unpin,
impl<T> UnwindSafe for RedisGILGuard<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