pub struct TaskQuery {
pub status: Option<String>,
pub kind: Option<String>,
pub parent_id: Option<Uuid>,
pub root_only: bool,
pub name: Option<String>,
pub queue_name: Option<String>,
pub sort: TaskSort,
pub limit: Option<u64>,
pub offset: Option<u64>,
}Expand description
Builder for filtering, sorting, and paginating task queries.
ⓘ
let query = TaskQuery::default()
.status("RUNNING")
.kind("WORKFLOW")
.root_only(true)
.sort(TaskSort::CreatedAt(Order::Desc))
.limit(20);
let tasks = Ctx::list(&db, query).await?;Fields§
§status: Option<String>§kind: Option<String>§parent_id: Option<Uuid>§root_only: bool§name: Option<String>§queue_name: Option<String>§sort: TaskSort§limit: Option<u64>§offset: Option<u64>Implementations§
Source§impl TaskQuery
impl TaskQuery
Sourcepub fn status(self, status: &str) -> Self
pub fn status(self, status: &str) -> Self
Filter by status (e.g. “RUNNING”, “PAUSED”, “CANCELLED”, “COMPLETED”, “FAILED”, “PENDING”).
Sourcepub fn parent_id(self, parent_id: Uuid) -> Self
pub fn parent_id(self, parent_id: Uuid) -> Self
Filter by parent task ID (direct children only).
Sourcepub fn queue_name(self, queue: &str) -> Self
pub fn queue_name(self, queue: &str) -> Self
Filter by queue name.
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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>
Converts
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>
Converts
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