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.
Sourcepub fn impact(&self, id: &str, depth: usize) -> Result<Vec<WalkHit>>
pub fn impact(&self, id: &str, depth: usize) -> Result<Vec<WalkHit>>
Transitive issues waiting on id, limited to depth hops.
§Errors
Returns an error if id is not in the catalog, or the blocker graph
cannot be built.
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for CatalogService<'a>
impl<'a> RefUnwindSafe for CatalogService<'a>
impl<'a> Send for CatalogService<'a>
impl<'a> Sync for CatalogService<'a>
impl<'a> Unpin for CatalogService<'a>
impl<'a> UnsafeUnpin for CatalogService<'a>
impl<'a> UnwindSafe for CatalogService<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more