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
//! Core abstractions for the pamoja device SDK.
//!
//! This crate defines the traits that every capability crate (for example
//! `pamoja-mqtt`, `pamoja-io-serial`, or `pamoja-ros2`) implements. The
//! core is protocol-agnostic: it models devices, sensors, actuators, transports,
//! durable storage, and an event bus, and leaves concrete protocol support to the
//! capability crates so that an application depends only on what it uses.
//!
//! The primary abstractions are:
//!
//! - [`Device`] - a connectable physical or virtual device.
//! - [`Sensor`] - a source of typed readings.
//! - [`Actuator`] - a sink for typed commands.
//! - [`Telemetry`] - a stream of telemetry frames.
//! - [`Transport`] - a bidirectional byte transport.
//! - [`Store`] - a durable store-and-forward queue.
//! - [`EventBus`] - a typed publish/subscribe channel.
//! - [`Error`] and [`Result`] - the shared error model.
//!
//! # Examples
//!
//! Implementing [`Sensor`] for a temperature probe:
//!
//! ```
//! use pamoja_core::{Result, Sensor};
//!
//! struct Thermometer {
//! celsius: f32,
//! }
//!
//! impl Sensor for Thermometer {
//! type Reading = f32;
//!
//! async fn read(&mut self) -> Result<Self::Reading> {
//! Ok(self.celsius)
//! }
//! }
//!
//! let _probe = Thermometer { celsius: 20.5 };
//! ```
// The public traits use `async fn`, which is intentional for this statically
// dispatched SDK; the associated lint is therefore allowed crate-wide.
pub use EventBus;
pub use ;
pub use ;
pub use Store;
pub use Transport;