tosca_controller/
lib.rs

1//! The `tosca-controller` library crate provides a set of APIs for managing,
2//! orchestrating, and interacting with all `tosca` devices within a
3//! network.
4//!
5//! A device is considered compliant with `tosca` if its firmware is built
6//! using the APIs of the `tosca` framework designed for the device's underlying
7//! hardware architecture.
8//!
9//! Core functionalities of this crate include:
10//!
11//! - Discovering all devices within the network that are compliant with the
12//!   `tosca` architecture
13//! - Constructing and sending `REST` requests to `tosca` devices to trigger
14//!   their tasks
15//! - Defining privacy policies to allow or block requests to a device
16//! - Intercepting device events by subscribing to the brokers where
17//!   they are published
18//!
19//! To optimize system resource usage, `tosca-controller` leverages `tokio` as
20//! an asynchronous executor, allowing concurrent execution of independent
21//! tasks. This approach improves performance, especially when running on
22//! multi-threaded systems, where tasks are distributed across
23//! multiple threads for additional efficiency.
24
25#![forbid(unsafe_code)]
26#![deny(missing_docs)]
27
28/// A controller for interacting with `tosca` devices.
29pub mod controller;
30/// Device data along with its associated methods.
31pub mod device;
32/// A service for discovering all `tosca` devices within a network.
33pub mod discovery;
34/// Error management.
35pub mod error;
36/// All events data.
37pub mod events;
38/// A privacy policy manager that blocks or allows the requests to devices
39/// based on a set of privacy rules.
40pub mod policy;
41/// Request data and the associated methods.
42pub mod request;
43/// All supported methods and data for handling `tosca` device responses.
44pub mod response;
45
46#[cfg(test)]
47mod tests;