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
//! Robomotion Rust SDK
//!
//! This library provides the official Rust SDK for building Robomotion packages.
//! It offers a runtime framework for creating plugin-based automation nodes that
//! communicate with the Robomotion platform via gRPC.
//!
//! # Example
//!
//! ```ignore
//! use robomotion::prelude::*;
//!
//! #[derive(Node, Default)]
//! #[node(id = "MyPackage.HelloWorld", name = "Hello World", icon = "mdiHand", color = "#3498db")]
//! struct HelloWorld {
//! node: NodeBase,
//!
//! #[input(title = "Name", var_type = "string", scope = "Message", name = "name")]
//! in_name: InVariable<String>,
//!
//! #[output(title = "Greeting", var_type = "string", scope = "Message", name = "greeting")]
//! out_greeting: OutVariable<String>,
//! }
//!
//! #[async_trait]
//! impl MessageHandler for HelloWorld {
//! async fn on_create(&mut self) -> Result<()> {
//! Ok(())
//! }
//!
//! async fn on_message(&mut self, ctx: &mut Context) -> Result<()> {
//! let name = self.in_name.get(ctx).await?;
//! self.out_greeting.set(ctx, format!("Hello, {}!", name)).await?;
//! Ok(())
//! }
//!
//! async fn on_close(&mut self) -> Result<()> {
//! Ok(())
//! }
//! }
//!
//! #[tokio::main]
//! async fn main() {
//! register_nodes![HelloWorld];
//! start().await;
//! }
//! ```
// Re-export commonly used types
// Re-export derive macro
pub use Node;