Enum glock::LockType

source ·
pub enum LockType {
    IntentionShared,
    IntentionExclusive,
    Shared,
    SharedIntentionExclusive,
    Exclusive,
}
Expand description

The type of lock that can be acquired for a GLock.

Variants§

§

IntentionShared

Before a Shared lock is acquired for a child GLock, IntentionShared locks must be acquired for each of its ancestors.

Compatibility

IntentionShared: Yes

IntentionExclusive: Yes

Shared: Yes

SharedIntentionExclusive: Yes

Exclusive: No

§

IntentionExclusive

Before an Exclusive or SharedIntentionExclusive lock is acquired for a child GLock, IntentionExclusive locks must be acquired for each of its ancestors.

Compatibility

IntentionShared: Yes

IntentionExclusive: Yes

Shared: No

SharedIntentionExclusive: No

Exclusive: No

§

Shared

A Shared lock grants read access to its protected data. Before acquiring a Shared lock for a child GLock, IntentionShared (or more restrictive) locks must be acquired for all its ancestors.

Compatibility

IntentionShared: Yes

IntentionExclusive: No

Shared: Yes

SharedIntentionExclusive: No

Exclusive: No

§

SharedIntentionExclusive

A SharedIntentionExclusive lock - as the name implies - is similar to holding both a Shared lock and an IntentionExclusive lock at the same time. Before acquiring a SharedIntentionExclusive lock for a child GLock, IntentionExclusive (or more restrictive) locks must be acquired for all its ancestors.

Compatibility

IntentionShared: Yes

IntentionExclusive: No

Shared: No

SharedIntentionExclusive: No

Exclusive: No

§

Exclusive

An Exclusive lock grants write access to its protected data. Before acquiring an Exclusive lock for a child GLock, IntentionExclusive (or more restrictive) locks must be acquired for all its ancestors.

Compatibility

IntentionShared: No

IntentionExclusive: No

Shared: No

SharedIntentionExclusive: No

Exclusive: No

Implementations§

Returns the numeric index corresponding to this lock type.

Returns the implicit parent lock type for this lock type. This means that, before acquiring this type of lock for a child GLock, locks of the implicit parent type must be acquired for all its ancestor GLocks.

Returns true if the lock type is compatible with the specified lock type, false otherwise.

Returns true if the lock type is upgradable to the specified lock type, false otherwise.

Returns true if the lock type can support child locks of the specified type, false otherwise. If true, this means that if a lock of this type is acquired for a parent GLock, a lock of the specified type can be acquired for a child GLock.

Returns the least restrictive lock type that this lock type can be upgraded to, that is at least as restrictive as the specified type.

Trait Implementations§

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Formats the value using the given formatter. Read more
This method tests for self and other values to be equal, and is used by ==. Read more
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more

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 resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
Converts the given value to a String. Read more
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.