Lines Matching full:backend

24 /// The "backend" of a lock.
36 /// [`lock`]: Backend::lock
37 /// [`unlock`]: Backend::unlock
38 /// [`relock`]: Backend::relock
39 pub unsafe trait Backend { interface
45 /// [`lock`]: Backend::lock
46 /// [`unlock`]: Backend::unlock
65 /// Callers must ensure that [`Backend::init`] has been previously called.
73 /// Callers must ensure that [`Backend::init`] has been previously called.
87 /// Callers must ensure that `guard_state` comes from a previous call to [`Backend::lock`] (or
88 /// variant) that has been unlocked with [`Backend::unlock`] and will be relocked now.
98 /// Callers must ensure that [`Backend::init`] has been previously called.
105 /// [`Backend`] specified as the generic parameter `B`.
108 pub struct Lock<T: ?Sized, B: Backend> {
124 unsafe impl<T: ?Sized + Send, B: Backend> Send for Lock<T, B> {}
128 unsafe impl<T: ?Sized + Send, B: Backend> Sync for Lock<T, B> {}
130 impl<T, B: Backend> Lock<T, B> {
145 impl<B: Backend> Lock<(), B> {
155 /// [`State`]: Backend::State
167 impl<T: ?Sized, B: Backend> Lock<T, B> {
189 /// Allows mutual exclusion primitives that implement the [`Backend`] trait to automatically unlock
193 pub struct Guard<'a, T: ?Sized, B: Backend> {
200 unsafe impl<T: Sync + ?Sized, B: Backend> Sync for Guard<'_, T, B> {}
202 impl<T: ?Sized, B: Backend> Guard<'_, T, B> {
215 impl<T: ?Sized, B: Backend> core::ops::Deref for Guard<'_, T, B> {
224 impl<T: ?Sized, B: Backend> core::ops::DerefMut for Guard<'_, T, B> {
231 impl<T: ?Sized, B: Backend> Drop for Guard<'_, T, B> {
238 impl<'a, T: ?Sized, B: Backend> Guard<'a, T, B> {
245 // SAFETY: The caller can only hold the lock if `Backend::init` has already been called. in new()