Skip to main content

TaskReader

Trait TaskReader 

Source
pub trait TaskReader: Send + Sync {
    // Required methods
    fn get_task<'life0, 'life1, 'async_trait>(
        &'life0 self,
        id: &'life1 ExternalId,
    ) -> Pin<Box<dyn Future<Output = Result<ExternalTask>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn list_by_status<'life0, 'async_trait>(
        &'life0 self,
        status: Status,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<ExternalTask>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;

    // Provided methods
    fn list_all_tasks<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<ExternalTask>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait { ... }
    fn list_reconciliation_candidates<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<ExternalTask>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait { ... }
    fn list_routable<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<ExternalTask>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait { ... }
    fn list_active_open_issues<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<(ExternalTask, Option<Status>)>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait { ... }
    fn has_open_issue_with_title<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        _title: &'life1 str,
        _label: &'life2 str,
    ) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait { ... }
}
Expand description

Reading tasks from the tracker

Required Methods§

Source

fn get_task<'life0, 'life1, 'async_trait>( &'life0 self, id: &'life1 ExternalId, ) -> Pin<Box<dyn Future<Output = Result<ExternalTask>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Fetch a task by its external ID.

Source

fn list_by_status<'life0, 'async_trait>( &'life0 self, status: Status, ) -> Pin<Box<dyn Future<Output = Result<Vec<ExternalTask>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

List tasks by status.

Provided Methods§

Source

fn list_all_tasks<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Vec<ExternalTask>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

List all tasks (open and closed) in a single API call.

This is more efficient than calling list_by_status for each status when you need counts or details for all statuses.

Source

fn list_reconciliation_candidates<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Vec<ExternalTask>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

List tasks for closed-issue reconciliation fallback.

Used when list_all_tasks fails (e.g., transient API issues). Default implementation returns an empty list, meaning no fallback data.

Source

fn list_routable<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Vec<ExternalTask>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

List open tasks that are routable — no status:* label yet, or status:new.

Default implementation falls back to list_by_status(New).

Source

fn list_active_open_issues<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Vec<(ExternalTask, Option<Status>)>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Fetch all open issues for ingest in a single logical call, returning each issue paired with its detected status (None = unlabeled/routable, Some(s) = has status label s).

The default implementation calls list_routable() followed by list_by_status() for each active non-new status, deduplicating by ID. Backends that support bulk listing (e.g. GitHub) should override this to fetch all open issues in one API call and partition locally, eliminating the 1 + N fan-out.

Source

fn has_open_issue_with_title<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, _title: &'life1 str, _label: &'life2 str, ) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Check if an open issue with the given title already exists.

Used for deduplication before creating issues. The label parameter narrows the search to issues with a specific label. Default returns false (no dedup for backends that don’t support it).

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§