pub trait Observer<Out: ?Sized> {
// Provided methods
fn on_first_poll(&mut self) { ... }
fn on_poll(&mut self) { ... }
fn on_poll_ready(&mut self, output: &Out) { ... }
fn on_finish(&mut self, output: Option<&Out>) { ... }
fn on_drop(&mut self) { ... }
}
Expand description
Represents an observer, which reacts to different events happening to the future.
If any of the functions is used incorrectly, implementation’s behaviour could be undefined but must always be safe.
Provided Methods§
Sourcefn on_first_poll(&mut self)
fn on_first_poll(&mut self)
Called once before the first future’s poll.
Sourcefn on_poll_ready(&mut self, output: &Out)
fn on_poll_ready(&mut self, output: &Out)
Called once after the future returns Poll::Ready
.