cartulary 0.3.0-alpha.1

The knowledge layer of your project — decisions, issues, docs, all in one place.
Documentation
//! Port: read the *content composition* of an issue — every named
//! part that belongs to it (`index`, companions, attachments) and
//! every cross-reference between parts.
//!
//! Distinct from [`IssueRepository`]: that port speaks
//! [`Issue`](crate::domain::model::issue::Issue) (parsed frontmatter,
//! validated fields). This one speaks *content set*: which parts
//! exist, which parts reference which. The vocabulary is
//! backend-agnostic — a filesystem adapter materialises parts as
//! files, but a SQLite or git-objects adapter would project rows or
//! blobs to the same shape.

use crate::domain::model::record_ref::IssueRef;

/// All content parts belonging to an issue, plus their outgoing
/// references. `parts` enumerates every local identifier (canonical
/// `index`, companions, attachments). `references` lists, for each
/// part that contains references, the targets it points at.
pub struct IssueContentSet {
    pub parts: Vec<String>,
    pub references: Vec<(String, Vec<String>)>,
}

pub trait IssueContentReader {
    fn content_of(&self, id: &IssueRef) -> anyhow::Result<Option<IssueContentSet>>;
}