pub unsafe trait RawRwLockUpgradeTimed: RawRwLockUpgrade + RawRwLockTimed {
// Required methods
fn try_lock_upgradable_for(
&self,
timeout: Self::Duration,
) -> Option<Self::UpgradableGuard>;
fn try_lock_upgradable_until(
&self,
timeout: Self::Instant,
) -> Option<Self::UpgradableGuard>;
unsafe fn try_upgrade_for(
&self,
guard: Self::UpgradableGuard,
timeout: Self::Duration,
) -> Result<Self::ExclusiveGuard, Self::UpgradableGuard>;
unsafe fn try_upgrade_until(
&self,
guard: Self::UpgradableGuard,
timeout: Self::Instant,
) -> Result<Self::ExclusiveGuard, Self::UpgradableGuard>;
}Expand description
Required Methods§
Sourcefn try_lock_upgradable_for(
&self,
timeout: Self::Duration,
) -> Option<Self::UpgradableGuard>
fn try_lock_upgradable_for( &self, timeout: Self::Duration, ) -> Option<Self::UpgradableGuard>
Attempts to acquire an upgradable lock until a timeout is reached.
See RawRwLockTimed::try_lock_shared_for for timeout behavior.
Sourcefn try_lock_upgradable_until(
&self,
timeout: Self::Instant,
) -> Option<Self::UpgradableGuard>
fn try_lock_upgradable_until( &self, timeout: Self::Instant, ) -> Option<Self::UpgradableGuard>
Attempts to acquire an upgradable lock until a timeout is reached.
See RawRwLockTimed::try_lock_shared_until for timeout behavior.
Sourceunsafe fn try_upgrade_for(
&self,
guard: Self::UpgradableGuard,
timeout: Self::Duration,
) -> Result<Self::ExclusiveGuard, Self::UpgradableGuard>
unsafe fn try_upgrade_for( &self, guard: Self::UpgradableGuard, timeout: Self::Duration, ) -> Result<Self::ExclusiveGuard, Self::UpgradableGuard>
Attempts to upgrade an upgradable lock to an exclusive lock until a timeout is reached.
See RawRwLockTimed::try_lock_exclusive_for for timeout behavior.
On success, returns Ok with the exclusive state. On failure, the
upgradable lock remains held and its state is returned in Err.
§Safety
This method requires the state for an upgradable acquisition of this lock held in the current context.
Sourceunsafe fn try_upgrade_until(
&self,
guard: Self::UpgradableGuard,
timeout: Self::Instant,
) -> Result<Self::ExclusiveGuard, Self::UpgradableGuard>
unsafe fn try_upgrade_until( &self, guard: Self::UpgradableGuard, timeout: Self::Instant, ) -> Result<Self::ExclusiveGuard, Self::UpgradableGuard>
Attempts to upgrade an upgradable lock to an exclusive lock until a timeout is reached.
See RawRwLockTimed::try_lock_exclusive_until for timeout behavior.
On success, returns Ok with the exclusive state. On failure, the
upgradable lock remains held and its state is returned in Err.
§Safety
This method requires the state for an upgradable acquisition of this lock held in the current context.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".