77//! Clients (desktop app, CLI, etc) send [`Request`]s
88//! and the runtime (device or emulator) sends back [`Response`]s.
99use crate :: encode:: Encode ;
10+ use alloc:: boxed:: Box ;
11+ use alloc:: string:: String ;
1012use serde:: { Deserialize , Serialize } ;
1113
1214/// Messages that clients send into the runtime.
@@ -22,6 +24,24 @@ pub enum Request {
2224
2325 /// Turn on/off collection and sending of runtime stats.
2426 Stats ( bool ) ,
27+
28+ /// Get the full ID of the currently running app.
29+ AppId ,
30+
31+ /// Take a screenshot.
32+ Screenshot ,
33+
34+ /// Launch an app.
35+ Launch ( ( String , String ) ) ,
36+
37+ /// Launch the launcher.
38+ Exit ,
39+
40+ /// Send buttons input.
41+ Buttons ( u8 ) ,
42+
43+ /// Send data into the running app.
44+ Data ( Box < [ u8 ] > ) ,
2545}
2646
2747impl Encode < ' _ > for Request { }
@@ -37,8 +57,12 @@ pub enum Response {
3757 CPU ( CPU ) ,
3858 /// Linear memory used by the wasm app.
3959 Memory ( Memory ) ,
40- /// Log record
41- Log ( alloc:: string:: String ) ,
60+ /// Log record.
61+ Log ( String ) ,
62+ /// Full ID of the currently running app.
63+ AppID ( ( String , String ) ) ,
64+ /// A generic confirmation response for a request.
65+ Ok ,
4266}
4367
4468impl Encode < ' _ > for Response { }
@@ -51,7 +75,7 @@ pub enum Callback {
5175 Update ,
5276 /// The `render` wasm callback.
5377 Render ,
54- /// The `render_line` wasm callback.
78+ /// DEPRECATED: The `render_line` wasm callback.
5579 RenderLine ,
5680 /// The `cheat` wasm callback.
5781 Cheat ,
0 commit comments