Skip to main content

RunListQuery

Struct RunListQuery 

Source
pub struct RunListQuery { /* private fields */ }
Expand description

Which runs RunsApi::list returns. Only the settings given a value are sent, except since and only_tasks, which are always sent.

use std::time::{Duration, SystemTime};
use hatchet_rest::{RunListQuery, TaskStatus};

let query = RunListQuery::new()
    .since(SystemTime::now() - Duration::from_secs(3600))
    .statuses([TaskStatus::Failed])
    .additional_metadata([("customer", "acme")])
    .limit(20);

Implementations§

Source§

impl RunListQuery

Source

pub fn new() -> Self

Every run, DAG rows and task rows alike (only_tasks=false, as in the official Python SDK).

Without since the query asks for runs since 1970-01-01 — v0.107.0 refuses a run list without since (400), so it is always sent.

Source

pub fn since(self, since: SystemTime) -> Self

Runs created at or after since.

Source

pub fn until(self, until: SystemTime) -> Self

Runs created before until.

Source

pub fn statuses(self, statuses: impl IntoIterator<Item = TaskStatus>) -> Self

Only these statuses.

Source

pub fn workflow_ids( self, ids: impl IntoIterator<Item = impl Into<String>>, ) -> Self

Only these workflows (by id).

Source

pub fn worker_id(self, id: impl Into<String>) -> Self

Only runs on this worker.

Source

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

Task rows only, no DAG rows.

Source

pub fn parent_task_external_id(self, id: impl Into<String>) -> Self

Only children of this task run.

Source

pub fn triggering_event_external_id(self, id: impl Into<String>) -> Self

Only runs this event triggered.

Source

pub fn additional_metadata<K: AsRef<str>, V: AsRef<str>>( self, pairs: impl IntoIterator<Item = (K, V)>, ) -> Self

Only runs carrying these metadata pairs, sent as "key:value". How several pairs combine is the engine’s default unless metadata_operator says otherwise.

Source

pub fn metadata_operator(self, operator: MetadataOperator) -> Self

How several metadata pairs combine. Not in the v0.80.0 spec.

Source

pub fn include_payloads(self, include: bool) -> Self

Whether rows carry inputs and outputs.

Source

pub fn running_filter(self, filter: RunningFilter) -> Self

Which running tasks to return.

Source

pub fn idempotency_keys( self, keys: impl IntoIterator<Item = impl Into<String>>, ) -> Self

Only runs with these idempotency keys. Not in the v0.80.0 spec, and a v0.80.0 engine was observed to ignore it (every run is listed).

Source

pub fn offset(self, offset: i64) -> Self

Skip this many.

Source

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

At most this many.

Trait Implementations§

Source§

impl Clone for RunListQuery

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for RunListQuery

Source§

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

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

impl Default for RunListQuery

Source§

fn default() -> Self

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

Auto Trait Implementations§

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

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

Source§

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>,

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

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

Source§

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.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more