Skip to main content

Run

Struct Run 

Source
pub struct Run {
Show 23 fields pub run_id: String, pub job_id: Option<String>, pub script_name: String, pub parent_run_id: Option<String>, pub root_run_id: Option<String>, pub child_index: Option<i32>, pub scheduled_for: DateTime<Utc>, pub started_at: Option<DateTime<Utc>>, pub finished_at: Option<DateTime<Utc>>, pub duration_ms: Option<i64>, pub status: RunStatus, pub attempt: i32, pub instance_id: Option<String>, pub placement_json: Option<Value>, pub pool_id: Option<String>, pub actor_json: Value, pub params_json: Value, pub stdout_text: Option<String>, pub stderr_text: Option<String>, pub error_json: Option<Value>, pub stats_json: Option<Value>, pub claimed_by: Option<String>, pub claim_lease_until: Option<DateTime<Utc>>,
}
Expand description

An execution instance of a scheduled job.

Fields§

§run_id: String

Unique identifier (UUID).

§job_id: Option<String>

Job that spawned this run (None for ad-hoc child runs).

§script_name: String

Script being executed.

§parent_run_id: Option<String>

Parent run that spawned this run (for child runs).

§root_run_id: Option<String>

Root run in the lineage tree.

§child_index: Option<i32>

Index among siblings (for child runs).

§scheduled_for: DateTime<Utc>

When the run was scheduled to execute.

§started_at: Option<DateTime<Utc>>

When execution actually started.

§finished_at: Option<DateTime<Utc>>

When execution finished.

§duration_ms: Option<i64>

Execution duration in milliseconds.

§status: RunStatus

Current status of the run.

§attempt: i32

Retry attempt number (1 for first attempt).

§instance_id: Option<String>

Instance ID that executed this run.

§placement_json: Option<Value>

Placement information.

§pool_id: Option<String>

Target execution pool (distributed mode). None in DB means the "default" pool.

§actor_json: Value

Serialized Actor for identity reconstruction.

§params_json: Value

Parameters passed to the script.

§stdout_text: Option<String>

Captured stdout from the script.

§stderr_text: Option<String>

Captured stderr from the script.

§error_json: Option<Value>

Error details if the run failed.

§stats_json: Option<Value>

Execution statistics.

§claimed_by: Option<String>

Worker instance id while status is claimed / renewed during execution.

§claim_lease_until: Option<DateTime<Utc>>

Worker lease expiry for reclaim / failover.

Implementations§

Source§

impl Run

Source

pub fn new(script_name: impl Into<String>, scheduled_for: DateTime<Utc>) -> Self

Create a queued run with generated IDs and empty runtime fields.

The run starts in RunStatus::Queued. Timestamps, duration, and error details are populated later by start, complete, or fail.

Source

pub fn for_job( job_id: impl Into<String>, script_name: impl Into<String>, scheduled_for: DateTime<Utc>, ) -> Self

Create a run linked to a specific job.

Source

pub fn start(&mut self)

Mark the run as started.

Source

pub fn complete(&mut self)

Mark the run as successfully completed.

Source

pub fn fail(&mut self, error: impl Into<String>)

Mark the run as failed.

Source

pub fn timeout(&mut self, error: impl Into<String>)

Mark the run as timed out.

Trait Implementations§

Source§

impl Clone for Run

Source§

fn clone(&self) -> Run

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 Run

Source§

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

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

impl<'de> Deserialize<'de> for Run

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for Run

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

Auto Trait Implementations§

§

impl Freeze for Run

§

impl RefUnwindSafe for Run

§

impl Send for Run

§

impl Sync for Run

§

impl Unpin for Run

§

impl UnsafeUnpin for Run

§

impl UnwindSafe for Run

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> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

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.