pub unsafe trait RawCondvarTimed: RawCondvarwhere
Self::RawMutex: RawMutexTimed,{
// Required methods
fn checked_duration_to_instant(
timeout: &<Self::RawMutex as RawMutexTimed>::Duration,
) -> Option<<Self::RawMutex as RawMutexTimed>::Instant>;
unsafe fn wait_until(
&self,
mutex: &Self::RawMutex,
timeout: &<Self::RawMutex as RawMutexTimed>::Instant,
) -> bool;
// Provided method
unsafe fn wait_for(
&self,
mutex: &Self::RawMutex,
timeout: &<Self::RawMutex as RawMutexTimed>::Duration,
) -> bool { ... }
}Expand description
Additional methods for RawCondvar which support timeouts.
§Safety
Implementions must ensure that wait_for and wait_until are safe to call,
regardless of the specific RawMutex instance provided. If an implementation
only supports one instance at a time, waiting may panic.
Required Methods§
Sourcefn checked_duration_to_instant(
timeout: &<Self::RawMutex as RawMutexTimed>::Duration,
) -> Option<<Self::RawMutex as RawMutexTimed>::Instant>
fn checked_duration_to_instant( timeout: &<Self::RawMutex as RawMutexTimed>::Duration, ) -> Option<<Self::RawMutex as RawMutexTimed>::Instant>
Sourceunsafe fn wait_until(
&self,
mutex: &Self::RawMutex,
timeout: &<Self::RawMutex as RawMutexTimed>::Instant,
) -> bool
unsafe fn wait_until( &self, mutex: &Self::RawMutex, timeout: &<Self::RawMutex as RawMutexTimed>::Instant, ) -> bool
Wait until the provided RawMutex is available until the provided
timeout is reached.
§Safety
Caller must ensure the provided mutex is locked, and that they are the
owner of said lock for the duration of this call.
§Panics
Implementations are permitted to panic if requested to wait on two distinct
RawMutexs simultaneously.
Provided Methods§
Sourceunsafe fn wait_for(
&self,
mutex: &Self::RawMutex,
timeout: &<Self::RawMutex as RawMutexTimed>::Duration,
) -> bool
unsafe fn wait_for( &self, mutex: &Self::RawMutex, timeout: &<Self::RawMutex as RawMutexTimed>::Duration, ) -> bool
Wait until the provided RawMutex is available until the provided
timeout is reached.
§Safety
Caller must ensure the provided mutex is locked, and that they are the
owner of said lock for the duration of this call.
§Panics
Implementations are permitted to panic if requested to wait on two distinct
RawMutexs simultaneously.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".