Skip to main content

Job

Struct Job 

Source
pub struct Job {
Show 39 fields pub id: String, pub title: String, pub kind: String, pub badge: Option<JobBadge>, pub source: String, pub owner: Option<String>, pub command: Option<String>, pub orphaned: Option<String>, pub reason: Option<String>, pub parent: Option<String>, pub weight: f64, pub state: JobState, pub done: u64, pub total: Option<u64>, pub failed: u64, pub skipped: u64, pub item: Option<String>, pub item_progress: Option<f64>, pub phase: Option<String>, pub steps: Vec<Step>, pub step: Option<String>, pub hint: Option<f64>, pub refined: Option<f64>, pub fraction: Option<f64>, pub cancellable: bool, pub pausable: bool, pub retryable: bool, pub error: Option<String>, pub errors: Vec<ItemError>, pub actions: Vec<JobAction>, pub requested: Option<Request>, pub request_error: Option<String>, pub started_at: f64, pub updated_at: f64, pub ended_at: Option<f64>, pub attempts: u32, pub seq: u64, pub log_total: u64, pub serial: u64, /* private fields */
}
Expand description

A job, as the events made it.

Fields§

§id: String§title: String§kind: String

What kind of work (an icon role: export, import, render).

§badge: Option<JobBadge>

A symbol before its title (JobBadge).

§source: String

Who published it (the journal’s source).

§owner: Option<String>

The plugin it runs for, when its job.started named one.

§command: Option<String>

The command that started it, when its job.started named one.

§orphaned: Option<String>

The plugin it was left by: its owner is disconnected and the job goes on (job.orphaned).

§reason: Option<String>

Why it is being cancelled or was, when it was not the user (its plugin is disconnected).

§parent: Option<String>§weight: f64

Its share of its parent.

§state: JobState§done: u64§total: Option<u64>§failed: u64§skipped: u64§item: Option<String>

The item being worked on, and how far it is (0 to 1).

§item_progress: Option<f64>§phase: Option<String>§steps: Vec<Step>§step: Option<String>

The current step’s id.

§hint: Option<f64>

The host’s own estimate (0 to 1).

§refined: Option<f64>

The application’s estimate (Jobs::refine), overriding the model’s.

§fraction: Option<f64>

The estimated overall fraction (0 to 1); none: indeterminate.

§cancellable: bool§pausable: bool§retryable: bool§error: Option<String>§errors: Vec<ItemError>

The last failed items, oldest first.

§actions: Vec<JobAction>§requested: Option<Request>

What was asked of the host, until it answers.

§request_error: Option<String>

Why the host refused the last request.

§started_at: f64§updated_at: f64§ended_at: Option<f64>§attempts: u32

How many times it started (1, then retries).

§seq: u64

The last event that changed it.

§log_total: u64

Lines ever written to its log.

§serial: u64

Its place in the list (the order jobs first started in).

Implementations§

Source§

impl Job

Source

pub fn active(&self) -> bool

Whether it still goes on.

Source

pub fn determinate(&self) -> bool

Whether its fraction is known.

Source

pub fn percent(&self) -> Option<f64>

The estimated overall percentage (0 to 100); none: indeterminate.

Source

pub fn elapsed(&self, now: f64) -> f64

How long it ran, until now or its end.

Source

pub fn eta(&self, now: f64) -> Option<f64>

The seconds left, from the rate of its fraction: none before ETA_AFTER seconds, while indeterminate, paused or ended.

Trait Implementations§

Source§

impl Clone for Job

Source§

fn clone(&self) -> Job

Returns a duplicate 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 Job

Source§

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

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

impl PartialEq for Job

Source§

fn eq(&self, other: &Job) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for Job

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for Job

Auto Trait Implementations§

§

impl Freeze for Job

§

impl RefUnwindSafe for Job

§

impl Send for Job

§

impl Sync for Job

§

impl Unpin for Job

§

impl UnsafeUnpin for Job

§

impl UnwindSafe for Job

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