pub trait Observable<T: Send + Sync + Clone + 'static> {
// Required method
fn subscribe<S: Observer<T> + 'static>(&self, observer: &Arc<S>);
// Provided methods
fn poll(&self) -> T { ... }
fn poll_timeout(&self, duration: Duration) -> Result<T> { ... }
}
Expand description
Event publisher that may be subscribed to
Required Methods§
Provided Methods§
Sourcefn poll_timeout(&self, duration: Duration) -> Result<T>
fn poll_timeout(&self, duration: Duration) -> Result<T>
Waits for an event to be emitted with a timeout
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.