#[repr(u8)]pub enum JobStatus {
Show 14 variants
Unknown,
Created,
CreateFailed {
err: String,
},
Ready,
Initialized,
InitializeFailed {
err: String,
},
Started,
StartFailed {
err: String,
},
Completed,
CompleteFailed {
err: String,
},
Finished {
res: String,
},
Failed {
res: String,
},
Stopped {
signal: String,
},
DecodeFailed {
err: String,
},
}
Expand description
Edited: added comments + synced with new events.
Lists the possible states that a job can have from the brane-drv perspective.
Variants§
Unknown
Meta state for undefined states
Created
We successfully created a container for the call
CreateFailed
We could not create the container to run the call.
Carries
err
: A string describing why we failed to launch a job.
Ready
The container is ready with setting up the branelet executable (first opportunity for branelet to send events)
Initialized
The container has initialized its working directory
InitializeFailed
Something went wrong while setting up the working directory
Carries
err
: A string describing why we failed to intialize a job.
Started
The actual subcall executeable / script has started
StartFailed
The subprocess executable did not want to start (calling it failed)
Carries
err
: A string describing why we failed to start a job.
Completed
The subcall executable has finished without errors - at least, from the branelet’s side, that is
CompleteFailed
The subcall executable has finished with errors on the branelet side
Carries
err
: A string describing why we failed to complete a job.
Finished
The container has exited with a zero status code
Carries
res
: A JSON-formatted string (hopefully) containing the value of the finished job.
Failed
The container has exited with a non-zero status code
Carries
res
: A JSON-formatted string (hopefully) containing a code/stdout/stderr triplet of results of the failed job.
Stopped
The container was interrupted by the Job node
DecodeFailed
We could not decode the output from the package
Carries
err
: A string describing why we failed to decode the job output.
Implementations§
source§impl JobStatus
impl JobStatus
sourcepub fn order(&self) -> u32
pub fn order(&self) -> u32
Converts any of the states to a numeric number representing their ordering.
The earlier the state in a job’s lifecycle, the lower the number.
Returns
The ordering as an unsigned integer.
sourcepub fn reached(&self, target: &JobStatus) -> bool
pub fn reached(&self, target: &JobStatus) -> bool
Returns whether the this state is equal to or has surpassed the given state in terms of ordering.
In case they are equal, also requires the specific variants to be the same (not just the ordering).
Arguments
target
: The target state to check if the job has reached.
Returns
True if this state’s ordering is equal to or higher than the target’s ordering.
Trait Implementations§
impl Eq for JobStatus
impl StructuralPartialEq for JobStatus
Auto Trait Implementations§
impl Freeze for JobStatus
impl RefUnwindSafe for JobStatus
impl Send for JobStatus
impl Sync for JobStatus
impl Unpin for JobStatus
impl UnwindSafe for JobStatus
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T
in a tonic::Request