emixcore

Crates.ioemixcore
lib.rsemixcore
version0.6.0
created_at2026-01-11 14:02:02.470583+00
updated_at2026-01-11 14:02:02.470583+00
descriptionShared error handling, debug configuration, and foundational traits for EssentialMix.
homepage
repositoryhttps://github.com/asm2025/essentialmix-rs
max_upload_size
id2035856
size12,616
asm (asm2025)

documentation

README

emixcore

emixcore provides the shared error type, debug configuration toggle, and core traits that the other EssentialMix crates build upon.

Highlights

  • Error wraps workspace-specific failures while implementing std::error::Error.
  • Result<T> aliases std::result::Result<T, Error>.
  • set_debug / is_debug flip a global once-initialized flag used by helper crates.
  • system::num_cpus() respects the debug flag to make deterministic unit tests easier (returns 1 CPU when debug mode is active).
  • CallbackHandler<T> is a lightweight observer trait for progress reporting.

Quick Example

use emixcore::{set_debug, system, CallbackHandler};

struct Logger;

impl CallbackHandler<u64> for Logger {
    fn starting(&self) { println!("Starting"); }
    fn update(&self, progress: u64) { println!("Progress: {progress}%"); }
    fn completed(&self) { println!("Done"); }
}

fn main() {
    set_debug(true);
    assert_eq!(system::num_cpus(), 1);
}

Consult src/errors.rs for the detailed error taxonomy and tests/ for real-world integration coverage.

Commit count: 272

cargo fmt