pub struct CatalogService<'a> { /* private fields */ }Expand description
Read-only queries over a cached &[IssueRec].
Implementations§
Source§impl<'a> CatalogService<'a>
impl<'a> CatalogService<'a>
Sourcepub fn from_recs(issues: &'a [IssueRec]) -> Self
pub fn from_recs(issues: &'a [IssueRec]) -> Self
Query over an already-loaded catalog snapshot.
Sourcepub fn issues_rows(&self, q: ListQuery) -> Result<Vec<IssueRow>>
pub fn issues_rows(&self, q: ListQuery) -> Result<Vec<IssueRow>>
List rows matching q, same filters and sort as issues_rows_from.
§Errors
Does not fail for a parsed catalog.
Sourcepub fn ready(&self, project: Option<&str>) -> Result<Vec<IssueRow>>
pub fn ready(&self, project: Option<&str>) -> Result<Vec<IssueRow>>
Actionable issues: TODO or STARTED with no open blocker.
§Errors
Does not fail for a parsed catalog.
Sourcepub fn detail(&self, id: &str) -> Result<IssueDetail>
pub fn detail(&self, id: &str) -> Result<IssueDetail>
One issue as a detail card, including body and logbook.
§Errors
Returns an error if id is not in the catalog.
Sourcepub fn excerpt(&self, id: &str) -> Result<Excerpt>
pub fn excerpt(&self, id: &str) -> Result<Excerpt>
On-disk heading range, capped and screened for secrets.
§Errors
Returns an error if id is not in the catalog, or the heading’s file
cannot be read.
Sourcepub fn search(&self, query: &str, limit: usize) -> Result<Vec<SearchHit>>
pub fn search(&self, query: &str, limit: usize) -> Result<Vec<SearchHit>>
Case-insensitive substring scan over id, title, properties, and body.
§Errors
Does not fail for a parsed catalog.
Sourcepub fn claims(
&self,
holder: Option<&str>,
project: Option<&str>,
) -> Result<Vec<ClaimRow>>
pub fn claims( &self, holder: Option<&str>, project: Option<&str>, ) -> Result<Vec<ClaimRow>>
Live claims, oldest first, optionally narrowed by holder or project.
§Errors
Does not fail for a parsed catalog.
Sourcepub fn agenda(&self, days: i64, project: Option<&str>) -> Result<Vec<AgendaRow>>
pub fn agenda(&self, days: i64, project: Option<&str>) -> Result<Vec<AgendaRow>>
Dated open work in the next days days, plus anything already overdue.
§Errors
Does not fail for a parsed catalog.
Sourcepub fn children(&self, id: &str) -> Result<Vec<WalkHit>>
pub fn children(&self, id: &str) -> Result<Vec<WalkHit>>
Issues whose :PARENT: points at id.
§Errors
Returns an error if id is not in the catalog and no children exist.
Sourcepub fn ancestors(&self, id: &str, depth: usize) -> Result<Vec<WalkHit>>
pub fn ancestors(&self, id: &str, depth: usize) -> Result<Vec<WalkHit>>
Transitive blocker ancestors, limited to depth hops.
§Errors
Returns an error if id is not in the catalog, or the blocker graph
cannot be built.