bitpill 0.3.5

A personal medication management TUI application built in Rust.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use crate::application::errors::DeliveryError;
use crate::domain::{entities::dose_record::DoseRecord, entities::medication::Medication};

/// Abstracts the delivery of dose-reminder notifications to the user.
///
/// Implement this trait in the infrastructure layer (console, push, email, …).
/// Inject via `Arc<dyn NotificationPort>` into `ScheduleDoseService`.
pub trait NotificationPort: Send + Sync {
    /// Notify the user that a dose of `medication` is due now.
    ///
    /// `record` is the freshly created [`DoseRecord`] for this dose slot.
    fn notify_dose_due(
        &self,
        medication: &Medication,
        record: &DoseRecord,
    ) -> Result<(), DeliveryError>;
}