Skip to main content

FifoOutcome

Struct FifoOutcome 

Source
pub struct FifoOutcome<Role, Job, WorkerResult> { /* private fields */ }
Expand description

Complete customer-visible progress or terminal outcome for FIFO work.

The value is opaque so a pool can retain a non-Clone application role while an outcome borrows the same immutable role name. Exact consuming projections return owned payloads and results without exposing shared storage.

Implementations§

Source§

impl<Role, Job, WorkerResult> FifoOutcome<Role, Job, WorkerResult>

Source

pub const fn kind(&self) -> FifoOutcomeKind

Identify the customer-visible alternative without consuming it.

Source

pub fn role(&self) -> Option<&Role>

Borrow the semantic worker role carried by a terminal assigned outcome.

Source

pub const fn payload(&self) -> Option<&Job>

Borrow a returned customer payload, when present.

Source

pub const fn worker_result(&self) -> Option<&WorkerResult>

Borrow a completed worker result, when present.

Source

pub fn into_accepted(self) -> Result<(SubmissionId, JobId), Self>

Consume an accepted-admission outcome.

Source

pub fn into_rejected( self, ) -> Result<(SubmissionId, Job, AdmissionRejection), Self>

Consume a rejected-admission outcome and recover its complete payload.

Source

pub fn into_completed(self) -> Result<(JobId, WorkerResult), Self>

Consume a completed outcome after borrowing its role if needed.

Source

pub fn into_returned_queued( self, ) -> Result<(JobId, Job, QueuedReturnReason), Self>

Consume a returned queued outcome and recover its complete payload.

Source

pub fn into_returned_assigned( self, ) -> Result<(JobId, Job, AssignedReturnReason), Self>

Consume a returned assigned outcome after borrowing its role if needed.

Auto Trait Implementations§

§

impl<Role, Job, WorkerResult> Freeze for FifoOutcome<Role, Job, WorkerResult>
where Job: Freeze, WorkerResult: Freeze,

§

impl<Role, Job, WorkerResult> RefUnwindSafe for FifoOutcome<Role, Job, WorkerResult>
where Job: RefUnwindSafe, WorkerResult: RefUnwindSafe, Role: RefUnwindSafe,

§

impl<Role, Job, WorkerResult> Send for FifoOutcome<Role, Job, WorkerResult>
where Job: Send, WorkerResult: Send, Role: Sync + Send,

§

impl<Role, Job, WorkerResult> Sync for FifoOutcome<Role, Job, WorkerResult>
where Job: Sync, WorkerResult: Sync, Role: Sync + Send,

§

impl<Role, Job, WorkerResult> Unpin for FifoOutcome<Role, Job, WorkerResult>
where Job: Unpin, WorkerResult: Unpin,

§

impl<Role, Job, WorkerResult> UnsafeUnpin for FifoOutcome<Role, Job, WorkerResult>
where Job: UnsafeUnpin, WorkerResult: UnsafeUnpin,

§

impl<Role, Job, WorkerResult> UnwindSafe for FifoOutcome<Role, Job, WorkerResult>
where Job: UnwindSafe, WorkerResult: UnwindSafe, Role: RefUnwindSafe,

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