Struct sero::LockGuard

source ·
pub struct LockGuard<K>where
    K: Hash + Eq + Clone + Send + Sync + 'static,
{ /* private fields */ }
Expand description

Represents a hold on a specific lock.

The lock will be released and can be reacquired when the LockGuard is dropped.

Example

let guard = store.lock("test").wait();
// the lock is released here
drop(guard);

Trait Implementations§

Formats the value using the given formatter. Read more

Drops the LockGuard and releases the lock, allowing the next waiter to acquire it.

Example
let guard = store.lock("test").wait()
// drops the guard
drop(guard);

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.