pub trait Observer {
// Provided methods
fn step(&mut self, step: &dyn FlightStep) -> Result<(), SimError> { ... }
fn event(&mut self, event: &FlightEvent) { ... }
}Expand description
Watches a flight as it runs. Both methods do nothing by default; () watches nothing.
Provided Methods§
Sourcefn step(&mut self, step: &dyn FlightStep) -> Result<(), SimError>
fn step(&mut self, step: &dyn FlightStep) -> Result<(), SimError>
Sees every accepted integration step, in order.
§Errors
An error stops the flight and is returned from it.
Sourcefn event(&mut self, event: &FlightEvent)
fn event(&mut self, event: &FlightEvent)
Sees every flight event as it is recorded.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementations on Foreign Types§
impl Observer for ()
Source§impl<A: Observer, B: Observer> Observer for (A, B)
Two observers watch one flight: each sees every step and event, the first before the second.
impl<A: Observer, B: Observer> Observer for (A, B)
Two observers watch one flight: each sees every step and event, the first before the second.
Source§impl<T: Observer + ?Sized> Observer for &mut T
An observer lent to a flight, so the caller keeps it.
impl<T: Observer + ?Sized> Observer for &mut T
An observer lent to a flight, so the caller keeps it.