pub struct TaskQuery { /* private fields */ }Expand description
Query parameters for listing tasks with filtering and pagination.
TaskQuery::new()
.with_slot("build") // filter by slot
.with_active() // Pending | Running
.with_limit(50)
.with_offset(0)
│
▼ state.query(&q)
TaskPage { items: [Task, ...], total: 123 }An empty status filter matches all phases (no filtering).
Multiple with_status calls accumulate with OR semantics.
§Also
Implementations§
Source§impl TaskQuery
impl TaskQuery
Sourcepub fn new() -> Self
pub fn new() -> Self
Create a new query with default pagination (limit=100, offset=0) and without filters.
Sourcepub fn with_status(self, status: TaskPhase) -> Self
pub fn with_status(self, status: TaskPhase) -> Self
Add a phase filter. Multiple calls accumulate (OR semantics).
Sourcepub fn with_active(self) -> Self
pub fn with_active(self) -> Self
Filter by all active phases (Pending, Running).
Sourcepub fn with_terminal(self) -> Self
pub fn with_terminal(self) -> Self
Filter by all terminal phases.
Sourcepub fn with_limit(self, limit: usize) -> Self
pub fn with_limit(self, limit: usize) -> Self
Set page size. Capped at 1000.
Sourcepub fn with_offset(self, offset: usize) -> Self
pub fn with_offset(self, offset: usize) -> Self
Set the starting offset for pagination.
Sourcepub fn matches_phase(&self, phase: &TaskPhase) -> bool
pub fn matches_phase(&self, phase: &TaskPhase) -> bool
Returns true if the given phase passes the status filter.
An empty filter matches all phases.
Sourcepub fn status_filters(&self) -> &[TaskPhase]
pub fn status_filters(&self) -> &[TaskPhase]
Status filters.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for TaskQuery
impl RefUnwindSafe for TaskQuery
impl Send for TaskQuery
impl Sync for TaskQuery
impl Unpin for TaskQuery
impl UnsafeUnpin for TaskQuery
impl UnwindSafe for TaskQuery
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
Mutably borrows from an owned value. Read more