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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
// devela::run::iface
//
//! Defines `RunApp`, `RunRender`, `RunPresent`.
//!
//! Runtime-facing interfaces for stepwise participants.
//
use crate::;
/// App logic driven step-by-step by a runtime.
///
/// A runtime or driver gathers events, builds a [`RunStep`], and calls
/// [`run_step`][Self::run_step] to let the app update its state.
///
/// This trait only defines logical progression.
/// It does not define rendering, pacing, or backend services.
/// Minimal backend contract for runtime-driven frontends.
///
/// A `RunBackend` does two things:
/// - gathers normalized events for the next runtime iteration,
/// - exposes a short-lived backend context for that iteration.
///
/// It does **not** own:
/// - the runtime lifecycle,
/// - logical ticking,
/// - pacing,
/// - or application state progression.
///
/// Those belong to the runtime and the app layer.
///
/// The associated `Context<'a>` is intentionally ephemeral.
/// Typical examples include:
/// - a borrowed terminal output surface,
/// - a borrowed canvas handle,
/// - a borrowed window/document pair,
/// - or a lightweight host snapshot for the current frame.
/// Rendering logic driven by a runtime step.
///
/// A runtime or driver builds a [`RunStep`] and calls [`run_render`][Self::run_render]
/// to let a renderer project a scene or app state into its output representation.
///
/// This trait defines rendering only.
/// It does not define logical progression, pacing, or final presentation.
/// Presentation finalization driven by a runtime.
///
/// A runtime or driver calls [`run_present`][Self::run_present]
/// after rendering to finalize or expose the prepared output.
///
/// Typical examples include:
/// - flushing a terminal buffer,
/// - swapping a backbuffer,
/// - submitting queued draw commands.
///
/// This trait defines presentation only.
/// It does not define logical progression or rendering.