pub struct TaskRun { /* private fields */ }Expand description
Record of one execution attempt.
An active run has phase Running and no finish fields.
A finished run has a terminal phase and finishedAt.
Implementations§
Source§impl TaskRun
impl TaskRun
Sourcepub fn starting(
generation: u64,
attempt: u32,
workload: WorkloadTypeMeta,
) -> ModelResult<Self>
pub fn starting( generation: u64, attempt: u32, workload: WorkloadTypeMeta, ) -> ModelResult<Self>
Sourcepub fn from_parts(
workload: WorkloadTypeMeta,
generation: u64,
attempt: u32,
phase: TaskPhase,
started_at: SystemTime,
finished_at: Option<SystemTime>,
error: Option<String>,
exit_code: Option<i32>,
) -> ModelResult<Self>
pub fn from_parts( workload: WorkloadTypeMeta, generation: u64, attempt: u32, phase: TaskPhase, started_at: SystemTime, finished_at: Option<SystemTime>, error: Option<String>, exit_code: Option<i32>, ) -> ModelResult<Self>
Reconstructs a run from serialized fields.
§Errors
Returns ModelError::Invalid when identity fields, phase, timestamps, or terminal diagnostics are inconsistent.
Sourcepub fn finish(
&mut self,
phase: TaskPhase,
error: Option<String>,
exit_code: Option<i32>,
) -> ModelResult<()>
pub fn finish( &mut self, phase: TaskPhase, error: Option<String>, exit_code: Option<i32>, ) -> ModelResult<()>
Finishes an active run.
§Errors
Returns ModelError::Invalid when the run is already finished or phase is not terminal.
Sourcepub fn workload(&self) -> &WorkloadTypeMeta
pub fn workload(&self) -> &WorkloadTypeMeta
Workload GVK executed by this run.
Sourcepub fn generation(&self) -> u64
pub fn generation(&self) -> u64
Desired-state generation executed by this run.
Sourcepub fn started_at(&self) -> SystemTime
pub fn started_at(&self) -> SystemTime
Time when the run started.
Sourcepub fn finished_at(&self) -> Option<SystemTime>
pub fn finished_at(&self) -> Option<SystemTime>
Time when the run finished.
Sourcepub fn into_parts(
self,
) -> (WorkloadTypeMeta, u64, u32, TaskPhase, SystemTime, Option<SystemTime>, Option<String>, Option<i32>)
pub fn into_parts( self, ) -> (WorkloadTypeMeta, u64, u32, TaskPhase, SystemTime, Option<SystemTime>, Option<String>, Option<i32>)
Returns the serialized run fields.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for TaskRun
impl<'de> Deserialize<'de> for TaskRun
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for TaskRun
Source§impl JsonSchema for TaskRun
Available on crate feature schema only.
impl JsonSchema for TaskRun
Available on crate feature
schema only.Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
Whether JSON Schemas generated for this type should be included directly in parent schemas,
rather than being re-used where possible using the
$ref keyword. Read moreimpl StructuralPartialEq for TaskRun
Auto Trait Implementations§
impl Freeze for TaskRun
impl RefUnwindSafe for TaskRun
impl Send for TaskRun
impl Sync for TaskRun
impl Unpin for TaskRun
impl UnsafeUnpin for TaskRun
impl UnwindSafe for TaskRun
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more