pub trait NotifyWaiterInterface<OS: OsInterface>: Send {
// Required method
fn wait(&self, timeout: &Duration<OS>) -> bool;
// Provided method
fn wait_with<U>(
&self,
timeout: &Duration<OS>,
f: impl FnMut() -> Option<U>,
) -> Option<U> { ... }
}Required Methods§
Provided Methods§
Sourcefn wait_with<U>(
&self,
timeout: &Duration<OS>,
f: impl FnMut() -> Option<U>,
) -> Option<U>
fn wait_with<U>( &self, timeout: &Duration<OS>, f: impl FnMut() -> Option<U>, ) -> Option<U>
§Description
Wait for a notification, and call your function to check anything you want when receiving a notification. You can control whether or not to continue waiting for the next notification.
§Parameters
timeout: Total timeout.f: Your function. If it returnsSome(x), it will break out of the wait.
§Returns
None: It’s timeout.Some(x): The value returned by your function.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.