pub enum JobStatus {
Show 19 variants
Unknown,
Received,
Authorized,
Denied,
AuthorizationFailed(String),
Created,
CreationFailed(String),
Ready,
Initialized,
InitializationFailed(String),
Started,
StartingFailed(String),
Heartbeat,
Completed,
CompletionFailed(String),
Finished(FullValue),
Stopped,
DecodingFailed(String),
Failed(i32, String, String),
}
Expand description
Defines the possible states a job can have.
Variants§
Unknown
No status yet / unknown
Received
The job has been received by the job node.
Authorized
The job has been authorized by the job’s checker(s).
Denied
The job has been denied by the job’s checker(s).
AuthorizationFailed(String)
Authorization has failed.
Created
The job container has been created.
CreationFailed(String)
We failed to create the job container.
Ready
The branelet has been booted (first event it sends).
Initialized
The branelet node has been initialized; now only to spawn the job itself.
InitializationFailed(String)
We failed to initialize branelet.
Started
The actual subcall executeable / script has started
StartingFailed(String)
The subprocess executable did not want to start (calling it failed)
Heartbeat
Occassional message to let the user know the container is alive and running
Completed
The package call went successfully from the branelet’s side
CompletionFailed(String)
The package call went wrong from the branelet’s side
Finished(FullValue)
The container has exited with a zero status code (and returned the given value, which may be Void)
Stopped
The container was interrupted by the Job node
DecodingFailed(String)
brane-let could not decode the output from the package call
Failed(i32, String, String)
The container has exited with a non-zero status code
Implementations§
source§impl JobStatus
impl JobStatus
sourcepub fn from_status(
status: TaskStatus,
value: Option<String>,
) -> Result<Self, ExecuteError>
pub fn from_status( status: TaskStatus, value: Option<String>, ) -> Result<Self, ExecuteError>
Attempts to parse the given status & value into a JobStatus.
§Arguments
status
: The ExecuteState that provides the wire status.value
: The optional String value that we will parse to values or errors.
§Returns
A new JobStatus instance.
§Errors
This function errors if we failed to parse the string, or it was None when we expected Some.
sourcepub fn is_heartbeat(&self) -> bool
pub fn is_heartbeat(&self) -> bool
Returns whether this status is a heartbeat.
sourcepub fn progress_index(&self) -> u32
pub fn progress_index(&self) -> u32
Converts the JobStatus into some ‘progress index’, which is a number that can be used to determine if some JobStatus logically should be send after another.
§Returns
A number representing the progress index. If it’s higher than that of another JobStatus, this indicates its part of a later ‘step’ in the process.
Trait Implementations§
source§impl From<&JobStatus> for TaskStatus
impl From<&JobStatus> for TaskStatus
source§impl From<JobStatus> for TaskStatus
impl From<JobStatus> for TaskStatus
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<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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<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