Struct glock::GLockGuard

source ·
pub struct GLockGuard<'lck, T: 'lck> { /* private fields */ }
Expand description

A GLockGuard represents an acquired lock instance of any type. It can be used to access the protected data. The lock is released by dropping the GLockGuard object.

Implementations§

Returns the type of the lock currently held.

Upgrades the type of this GLockGuard to the specified type. If parent lock does not support the new type, it will be upgraded as well. If the lock is currently busy, it will block until it is ready.

Attempts to upgrade the type of this GLockGuard to the specified type. If parent lock does not support the new type, it will be upgraded as well. If the lock is currently busy, it will return a LockError::LockBusy error.

Upgrades the type of this GLockGuard to Exclusive. If parent lock does not support the new type, it will be upgraded as well. If the lock is currently busy, it will block until it is ready.

This method consumes the current GLockGuard and returns a new GLockGuardMut. In case of failure, it will return a tuple containing the error as well as the original GLockGuard.

Attempts to upgrade the type of this GLockGuard to Exclusive. If parent lock does not support the new type, it will be upgraded as well. If the lock is currently busy, If the lock is currently busy, it will return a LockError::LockBusy error.

This method consumes the current GLockGuard and returns a new GLockGuardMut. In case of failure, it will return a tuple containing the error as well as the original GLockGuard.

Trait Implementations§

Formats the value using the given formatter. Read more
The resulting type after dereferencing.
Dereferences the value.

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.