ailloli_ui_runtime/app/command.rs
1//! Legacy host commands emitted by runtime integrations.
2
3/// Side effect for the platform/application shell to perform.
4///
5/// Values are data only; constructing a command performs no redraw, cursor,
6/// clipboard, or URL operation. Modern callers normally use the typed methods
7/// on [`super::RuntimeHandle`] instead.
8///
9/// # Examples
10///
11/// ```
12/// use ailloli_ui_runtime::app::Command;
13/// assert_eq!(Command::RequestRedraw, Command::RequestRedraw);
14/// ```
15#[derive(Debug, Clone, PartialEq)]
16pub enum Command {
17 /// Ask the host to schedule a future redraw.
18 RequestRedraw,
19 /// Ask the host to select a cursor by backend-specific static name.
20 SetCursorIcon {
21 /// Unvalidated backend cursor identifier.
22 name: &'static str,
23 },
24 /// Ask the host to replace clipboard text.
25 ClipboardWrite {
26 /// Complete UTF-8 clipboard payload; an empty string is valid.
27 text: String,
28 },
29 /// Legacy request to open an unvalidated URL string.
30 #[deprecated(note = "use RuntimeHandle::open_external_url with a validated ExternalUrl")]
31 OpenUrl {
32 /// Unvalidated URL passed to the legacy host adapter.
33 url: String,
34 },
35}