Files
medicallib_rust/ARCHITECTURE.md
T
2025-09-21 02:14:44 -07:00

712 B

Architecture Overview

  • Crate facade in src/lib.rs re-exports curated types.
  • Error handling with thiserror via MedicalError and type Result<T>.
  • Core domain types in src/types.rs (e.g., BloodPressure, Blood).
  • Organ system:
    • Trait and common OrganInfo in src/organs/mod.rs
    • Per-organ modules (Heart, Lungs, Brain, etc.) implement Organ
  • Patient in src/patient.rs owns a vector of Box<dyn Organ> and coordinates updates.
  • FFI (feature ffi) in src/ffi.rs, header ffi/medicallib.h.
  • Examples in examples/, benches in benches/ (criterion).

Inter-organ communication examples:

  • Lungs SpO2 influences Heart rate.
  • Kidneys GFR produces urine into Bladder volume.