Trait RedisLockIndicator

Source
pub unsafe trait RedisLockIndicator { }
Expand description

Whenever the user gets a reference to a struct that implements this trait, it can assume that the Redis GIL is held. Any struct that implements this trait can be used to retrieve objects which are GIL protected (see RedisGILGuard for more information)

Notice that this trait only gives indication that the GIL is locked, unlike RedisGILGuard which protect data access and make sure the protected data is only accesses when the GIL is locked.

§Safety

In general this trait should not be implemented by the user, the crate knows when the Redis GIL is held and will make sure to implement this trait correctly on different struct (such as Context, [ConfigurationContext], ContextGuard). User might also decide to implement this trait but he should carefully consider that because it is easy to make mistakes, this is why the trait is marked as unsafe.

Implementors§