-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathgui.rs
More file actions
30 lines (27 loc) · 921 Bytes
/
Copy pathgui.rs
File metadata and controls
30 lines (27 loc) · 921 Bytes
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
use crate::{StdFunction, StdlibModule, StdlibRegistry};
use std::collections::HashMap;
use std::rc::Rc;
use techscript_runtime::{error::RuntimeError, value::RuntimeValue};
impl StdlibRegistry {
pub fn register_gui(&mut self) {
let mut exports: HashMap<String, Rc<dyn techscript_runtime::function::Callable>> =
HashMap::new();
exports.insert(
"alert".to_string(),
Rc::new(StdFunction {
name: "alert".to_string(),
arity: 1,
callback: |_ctx, _args| Ok(RuntimeValue::Str("GUI not yet available".to_string())),
}),
);
self.register_module(
"std.gui",
StdlibModule {
name: "std.gui".to_string(),
version: "1.0.0".to_string(),
exports,
required_capabilities: Vec::new(),
},
);
}
}