brinkhaustools/
lib.rs

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
//! Brinkhaus Tools — reusable infrastructure components for Brinkhaus industrial applications.
//!
//! This crate provides the core building blocks: shutdown handling, JSON settings,
//! self-diagnosis, status collection, heartbeat monitoring, logging, and version information.
//!
//! Enable the `fleet` feature for the FleetMonitorClient and StatusMonitor (adds reqwest + tokio),
//! and the `licence` feature for offline-verifiable, hardware-bound licences (adds ring).

mod shutdown;
mod settings;
mod diagnosis;
mod logging;
mod status;
mod heartbeat;
mod version;
mod app;
mod error;

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

#[cfg(feature = "fleet")]
mod client;
#[cfg(feature = "fleet")]
mod monitor;

pub use shutdown::{ShutdownHandler, ShutdownToken};
pub use settings::{RecoveredFrom, Settings};
pub use diagnosis::{DiagParam, DiagnosisMessage, MessagePart, SelfDiagnosisEngine, Severity};
pub use logging::{LoggingHelper, LoggingConfig, RingBuffer};
pub use status::{StatusEngine, StatusSource, StatusValue};
pub use heartbeat::HeartbeatEngine;
pub use version::VersionInformation;
pub use app::{App, AppBuilder};
pub use error::{Error, Result};

#[cfg(feature = "fleet")]
pub use client::{ChannelSource, DeviceIdentity, FleetMonitorClient, FleetClientConfig};
#[cfg(feature = "fleet")]
pub use monitor::{
    run_fleet_loops, run_fleet_loops_supervised, AckStrategy, CommandResult, CommandSpec,
    StatusMonitor,
};