flashkraft_core/lib.rs
1//! FlashKraft Core
2//!
3//! This crate contains all shared, framework-free logic that is reused by
4//! both the Iced desktop GUI (`flashkraft-gui`) and the Ratatui TUI
5//! (`flashkraft-tui`).
6//!
7//! ## Contents
8//!
9//! | Module | What lives here |
10//! |--------|-----------------|
11//! | [`domain`] | Domain models — [`DriveInfo`], [`ImageInfo`], drive constraints |
12//! | [`flash_helper`] | Privileged flash pipeline executed via `pkexec` |
13//! | [`flash_writer`] | Wire-protocol parser for helper ↔ supervisor communication |
14//! | [`commands`] | Async helpers — drive detection |
15//! | [`utils`] | Debug-logging macros (`debug_log!`, `flash_debug!`, …) |
16//!
17//! ## Dependency policy
18//!
19//! This crate intentionally has **no** GUI or TUI dependencies (no `iced`,
20//! no `ratatui`, no `crossterm`). It may only depend on:
21//! - OS / system crates (`sysinfo`, `nix`, `sha2`, …)
22//! - Async utilities (`tokio`, `futures`, `futures-timer`)
23//! - Persistence (`sled`, `dirs`)
24
25// Utility macros must be declared first so they are available to every
26// subsequent module via the implicit `#[macro_use]` on the crate root.
27#[macro_use]
28pub mod utils;
29
30pub mod commands;
31pub mod domain;
32pub mod flash_helper;
33pub mod flash_writer;
34
35// ── Convenience re-exports ────────────────────────────────────────────────────
36
37pub use domain::{DriveInfo, ImageInfo};