pub trait WaitNotice {
// Required method
fn waiting(&mut self);
// Provided method
fn slow(&mut self, _waited: Duration) { ... }
}Expand description
What:
Something told once that an acquirer has to wait,
such as a stderr notice.
A trait is an interface a type implements.
Why:
A waiter may tell the user whose lock it waits for;
the lock module stays silent.
In TS you’d write (pseudocode):
type OnWait = () => void;Required Methods§
Provided Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementors§
impl WaitNotice for SilentWait
Waiting silently does nothing.