Skip to main content

systemprompt_models/content/
ingestion.rs

1//! Content ingestion report accumulators.
2//!
3//! Copyright (c) systemprompt.io — Business Source License 1.1.
4//! See <https://systemprompt.io> for licensing details.
5
6#[derive(Debug, Clone, Default)]
7pub struct IngestionReport {
8    pub files_found: usize,
9    pub files_processed: usize,
10    pub errors: Vec<String>,
11}
12
13impl IngestionReport {
14    pub fn new() -> Self {
15        Self::default()
16    }
17
18    pub const fn has_errors(&self) -> bool {
19        !self.errors.is_empty()
20    }
21
22    pub const fn successful_count(&self) -> usize {
23        self.files_processed.saturating_sub(self.errors.len())
24    }
25
26    pub const fn failed_count(&self) -> usize {
27        self.errors.len()
28    }
29}