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

source

pub fn all() -> Self

Include all tasks without applying any filters nor limits.

caution: It does include ALL tasks without a limit.

source

pub fn limit(self, limit: u64) -> Self

Set the maximum amount of tasks that are retrieved.

source

pub fn active(self, active: bool) -> Self

Only include active or inactive tasks.

source

pub fn with_worker_selector(self, selector: WorkerSelector) -> Self

Only include tasks with a matching worker selector.

source

pub fn with_label(self, label: &str) -> Self

Select tasks that contain the given label with any value.

source

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.

Trait Implementations§

source§

impl Clone for Tasks

source§

fn clone(&self) -> Tasks

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Tasks

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for Tasks

source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl Freeze for Tasks

§

impl RefUnwindSafe for Tasks

§

impl Send for Tasks

§

impl Sync for Tasks

§

impl Unpin for Tasks

§

impl UnwindSafe for Tasks

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.