hara_native/lang/protocol/
ispace.rs1use hara_protocol_macros::hara_protocol;
2
3#[hara_protocol(namespace = "std.protocol.ispace", name = "ISpace")]
4pub trait ISpace<C, K, O> {
5 type Runtime;
6
7 #[hara_method(value = "context-set", arity = 4)]
8 fn context_set(&mut self, context: C, key: K, options: O);
9 #[hara_method(value = "context-unset", arity = 2)]
10 fn context_unset(&mut self, context: &C);
11 #[hara_method(value = "context-list", arity = 1)]
12 fn context_list(&self) -> Vec<C>;
13 #[hara_method(value = "context-get", arity = 2)]
14 fn context_get(&self, context: &C) -> Option<O>;
15 #[hara_method(value = "rt-active", arity = 1)]
16 fn runtime_active(&self) -> Vec<Self::Runtime>;
17 #[hara_method(value = "rt-get", arity = 2)]
18 fn runtime_get(&self, context: &C) -> Option<Self::Runtime>;
19 #[hara_method(value = "rt-start", arity = 2)]
20 fn runtime_start(&mut self, context: C) -> Self::Runtime;
21 #[hara_method(value = "rt-started?", arity = 2)]
22 fn runtime_started(&self, context: &C) -> bool;
23 #[hara_method(value = "rt-stopped?", arity = 2)]
24 fn runtime_stopped(&self, context: &C) -> bool;
25 #[hara_method(value = "rt-stop", arity = 2)]
26 fn runtime_stop(&mut self, context: &C);
27}