Struct ora_client::Tasks
source · pub struct Tasks {Show 14 fields
pub include_status: Option<HashSet<TaskStatus>>,
pub include_labels: Option<Vec<LabelMatch>>,
pub schedule_id: Option<Uuid>,
pub search: Option<String>,
pub added_after: Option<OffsetDateTime>,
pub added_before: Option<OffsetDateTime>,
pub finished_after: Option<OffsetDateTime>,
pub finished_before: Option<OffsetDateTime>,
pub target_after: Option<OffsetDateTime>,
pub target_before: Option<OffsetDateTime>,
pub kind: Option<String>,
pub order: TaskListOrder,
pub offset: u64,
pub limit: u64,
}
Expand description
Search options for retrieving a list of tasks.
Fields§
§include_status: Option<HashSet<TaskStatus>>
Only return tasks with the given status.
include_labels: Option<Vec<LabelMatch>>
Include only matching labels.
schedule_id: Option<Uuid>
Only return tasks for a given schedule.
search: Option<String>
A search text, how it is used is up to the store.
added_after: Option<OffsetDateTime>
Only include tasks added after the given timestamp (inclusive).
added_before: Option<OffsetDateTime>
Only include tasks added before the given timestamp (exclusive).
finished_after: Option<OffsetDateTime>
Only include tasks finished after the given timestamp (inclusive).
finished_before: Option<OffsetDateTime>
Only include tasks finished before the given timestamp (exclusive).
target_after: Option<OffsetDateTime>
Only include tasks with a target after the given timestamp (inclusive).
target_before: Option<OffsetDateTime>
Only include tasks with a target before the given timestamp (exclusive).
kind: Option<String>
Only return tasks with the provided worker selector kind.
order: TaskListOrder
The way tasks are ordered before applying offset and limit.
offset: u64
The task offset.
limit: u64
The maximum amount of tasks to fetch.
Implementations§
source§impl Tasks
impl Tasks
sourcepub fn all() -> Self
pub fn all() -> Self
Include all tasks without applying any filters nor limits.
caution: It does include ALL tasks without a limit.
sourcepub fn with_worker_selector(self, selector: WorkerSelector) -> Self
pub fn with_worker_selector(self, selector: WorkerSelector) -> Self
Only include tasks with a matching worker selector.
sourcepub fn with_label(self, label: &str) -> Self
pub fn with_label(self, label: &str) -> Self
Select tasks that contain the given label with any value.
sourcepub fn with_label_value(self, label: &str, value: impl Serialize) -> Self
pub fn with_label_value(self, label: &str, value: impl Serialize) -> Self
Select tasks that contain the given label and a specific value.
§Panics
Panics if the given value is not JSON-serializable.