Skip to main content

OperationFilter

Struct OperationFilter 

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

Which operations Client::list_operations should return.

Every filter is optional and they combine; the default asks for everything the cluster is willing to answer with, which is the most recent operations up to its own limit.

use ytsaurus_client::OperationFilter;

let mine = OperationFilter::new()
    .with_user("robot-loader")
    .with_state("running")
    .with_limit(20);

Implementations§

Source§

impl OperationFilter

Source

pub fn new() -> Self

No filter at all.

Source

pub fn with_user(self, user: impl AsRef<str>) -> Self

Only operations started by this user.

Source

pub fn with_state(self, state: impl AsRef<str>) -> Self

Only operations in this state — running, completed, failed, …

Source

pub fn with_kind(self, kind: OperationType) -> Self

Only operations of this type.

Source

pub fn with_pool(self, pool: impl AsRef<str>) -> Self

Only operations in this pool.

Source

pub fn with_pool_tree(self, tree: impl AsRef<str>) -> Self

Only operations in this pool tree.

Source

pub fn with_substring(self, text: impl AsRef<str>) -> Self

Only operations whose id, alias, user or spec contains this text.

The cluster calls it filter; this is the free-text search the web interface’s search box sends.

Source

pub fn with_from_time(self, time: impl AsRef<str>) -> Self

Only operations that started at or after this time.

An ISO 8601 timestamp as the cluster writes them — 2026-08-06T09:21:23.534387Z. This crate has no date type and does not want a dependency on one, so the timestamps go across as text, exactly as they come back in OperationInfo::start_time.

Source

pub fn with_to_time(self, time: impl AsRef<str>) -> Self

Only operations that started at or before this time.

See OperationFilter::with_from_time for the spelling.

Source

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

Only operations that have failed jobs.

Source

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

Also look in the operations archive, not only at what the scheduler still holds.

This is how an operation that finished a while ago is found at all — and it needs an archive, which a local cluster does not have.

Source

pub fn with_limit(self, limit: u32) -> Self

At most this many operations.

Source

pub fn with_raw(self, key: impl AsRef<str>, value: YsonValue) -> Self

Sets any filter this builder does not model — cursor_time, cursor_direction, include_counters.

Source

pub fn to_yson(&self) -> YsonValue

The filter as list_operations wants it.

Trait Implementations§

Source§

impl Clone for OperationFilter

Source§

fn clone(&self) -> OperationFilter

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 OperationFilter

Source§

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

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

impl Default for OperationFilter

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

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