iot-core 0.0.1

Core types for the iot-protocols SDK: Thing model, IotClient trait, errors, paths, protocol bindings.
Documentation
//! # iot-core
//!
//! Foundation crate for the `iot-protocols` SDK. Defines the data model
//! that every protocol implementation in the workspace agrees on:
//!
//! - [`thing`] — Eclipse-Ditto-style `Thing` / `Feature` / `Value` digital twin.
//! - [`path`] — `PropertyPath`, the protocol-agnostic address of a single value.
//! - [`binding`] — `ProtocolBinding` / `ThingMapping`, the bridge that maps a
//!   `PropertyPath` onto a Modbus register, an MQTT topic, a CoAP URI, or an
//!   OPC UA NodeId.
//! - [`error`] — the unified [`error::IotError`] every public API returns.
//! - [`client`] — the [`client::IotClient`] async trait every protocol crate
//!   implements alongside its native API.
//!
//! ## Feature flags
//!
//! | Feature   | Adds                                    | Default |
//! |-----------|-----------------------------------------|:-------:|
//! | `std`     | `std::error::Error` impls, hashing      | ✓       |
//! | `alloc`   | `Thing`, `Vec`, dynamic `BTreeMap` maps | ✓       |
//! | `serde`   | `serde::{Serialize,Deserialize}` derives|         |
//! | `validate`| JSON-Schema validation of `Thing`       |         |
//!
//! With only `alloc` (no `std`) every public type continues to work, which is
//! the configuration MCU targets compile.

#![cfg_attr(not(feature = "std"), no_std)]
#![warn(missing_docs)]
#![warn(rust_2018_idioms)]
#![forbid(unsafe_code)]

#[cfg(feature = "alloc")]
extern crate alloc;

pub mod binding;
pub mod client;
pub mod error;
pub mod path;
pub mod thing;
pub mod value;

#[cfg(feature = "validate")]
pub mod schema;

// Convenience re-exports — keeps user-facing imports terse.
pub use binding::{
    ByteOrder, ContentFormat, DataType, PayloadCodec, ProtocolBinding, Qos, RegisterArea,
    ThingMapping,
};
pub use client::IotClient;
pub use client::PropertySample;
pub use error::{CodecError, IotError, IotResult, TransportError};
pub use path::PropertyPath;
pub use thing::{DefinitionIdentifier, Feature, FeatureId, PolicyId, PropertyId, Thing, ThingId};
pub use value::Value;