Skip to main content

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`] | In-process flash pipeline — [`run_pipeline`], [`FlashEvent`], [`FlashStage`] |
13//! | [`commands`] | Async helpers — drive detection |
14//! | [`utils`] | Debug-logging macros (`debug_log!`, `flash_debug!`, …) |
15//!
16//! ## Dependency policy
17//!
18//! This crate intentionally has **no** GUI or TUI dependencies (no `iced`,
19//! no `ratatui`, no `crossterm`).  It may only depend on:
20//! - OS / system crates (`sysinfo`, `nix`, `sha2`, …)
21//! - Async utilities (`tokio`, `futures`, `futures-timer`)
22//! - Persistence (`sled`, `dirs`)
23
24// Utility macros must be declared first so they are available to every
25// subsequent module via the implicit `#[macro_use]` on the crate root.
26#[macro_use]
27pub mod utils;
28
29pub mod commands;
30pub mod domain;
31pub mod flash_helper;
32
33// ── Convenience re-exports ────────────────────────────────────────────────────
34
35pub use domain::{DriveInfo, ImageInfo};
36
37/// Re-export the flash pipeline event types so consumers only need to import
38/// from `flashkraft_core` rather than the sub-module path.
39pub use flash_helper::{FlashEvent, FlashStage};