1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
//! The contract a host's loop implements, and the headless loop's own
//! implementation of it.
use Box;
use crateApp;
use crateWorld;
use crateCnResult;
/// A loop that runs a [`World`].
///
/// [`App`] is the implementation with nothing underneath it: a fixed virtual
/// timestep, no window, and no wall clock. A host that has an operating system
/// implements this over its own loop, and what such a host adds -- pacing a
/// frame against a display, following real elapsed time, catching a signal --
/// stays on its side of the seam.
///
/// [`run`](Driver::run) reports whether the run failed rather than how it
/// ended. A [`StepResult`](crate::ecs::StepResult) is a system's verdict on its
/// own tick, and a host ends a run for reasons no system sees, so a driver that
/// reported one would owe readings for them.
///
/// `run` consumes the driver, since a run ends the world it was handed;
/// [`into_world`](Driver::into_world) is the other way out, for a caller that
/// wants the world back instead of run.