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
67
68
69
70
71
72
73
74
//! `srad` is a [Sparkplug](https://sparkplug.eclipse.org/) edge node and application development framework in Rust.
//!
//! # Overview
//!
//! `srad` aims to make it easy as possible to build reliable, fast, and resource efficient Sparkplug B Edge Nodes and Applications with minimal overhead.
//!
//! This is a convenient crate that re-exports the other `srad` crates. See those crates for docs etc.
//!
//! # Example
//!
//! Some super simple "Hello, World!" examples:
//!
//! ## Edge Node
//!
//! ```rust no_run
//! use srad::{client_rumqtt, eon::{EoN, EoNBuilder, NoMetricManager}};
//!
//! #[tokio::main]
//! async fn main() {
//!
//! let opts = client_rumqtt::MqttOptions::new("foo:bar", "localhost", 1883);
//! let (eventloop, client) = client_rumqtt::EventLoop::new(opts, 0);
//!
//! let (mut eon, handle) = EoNBuilder::new(eventloop, client)
//! .with_group_id("foo")
//! .with_node_id("bar")
//! .with_metric_manager(NoMetricManager::new())
//! .build().unwrap();
//!
//! eon.run().await;
//! }
//! ```
//!
//! ## Application
//!
//! ```rust no_run
//! use srad::app::{SubscriptionConfig, generic_app::ApplicationBuilder};
//! use srad::client_rumqtt;
//!
//! #[tokio::main]
//! async fn main() {
//! let opts = client_rumqtt::MqttOptions::new("foo", "localhost", 1883);
//! let (eventloop, client) = client_rumqtt::EventLoop::new(opts, 0);
//! let (mut application, client) = ApplicationBuilder::new("foo", eventloop, client, SubscriptionConfig::AllGroups).build();
//! application.run().await
//! }
//! ```
//!
//! # Examples
//!
//! The `srad` repo contains [a number of examples](https://github.com/dpazj/srad/tree/master/examples) that can help get you started.
//!
//! # Feature Flags
//!
//! - `eon`: Enables the Edge Node SDK. Enabled by default.
//! - `app`: Enables the Application SDK. Enabled by default.
//! - `rumqtt-client`: Enables the Rumqtt client implementation. Enabled by default.
//!
pub use srad_eon as eon;
pub use srad_app as app;
pub use srad_client as client;
pub use srad_client_rumqtt as client_rumqtt;