pub struct Assignment<Job> { /* private fields */ }Expand description
One worker execution payload with affine completion authority.
Only a pool can issue an assignment:
ⓘ
let _ = behavior_actors::atomic::Assignment::new(String::from("job"));Completing consumes the affine authority, so the same assignment cannot complete twice:
ⓘ
fn duplicate(assignment: behavior_actors::atomic::Assignment<u8>) {
let _first = assignment.complete(10_u16);
let _second = assignment.complete(11_u16);
}Implementations§
Source§impl<Job> Assignment<Job>
impl<Job> Assignment<Job>
Sourcepub const fn payload(&self) -> &Job
pub const fn payload(&self) -> &Job
Borrow the execution payload without exposing pool correlation.
Sourcepub fn complete<WorkerResult>(
self,
worker_result: WorkerResult,
) -> ReportToParent<Completion<WorkerResult>>
pub fn complete<WorkerResult>( self, worker_result: WorkerResult, ) -> ReportToParent<Completion<WorkerResult>>
Consume the assignment and return one opaque completion to its pool.
Trait Implementations§
Auto Trait Implementations§
impl<Job> Freeze for Assignment<Job>where
Job: Freeze,
impl<Job> RefUnwindSafe for Assignment<Job>where
Job: RefUnwindSafe,
impl<Job> Send for Assignment<Job>where
Job: Send,
impl<Job> Sync for Assignment<Job>where
Job: Sync,
impl<Job> Unpin for Assignment<Job>where
Job: Unpin,
impl<Job> UnsafeUnpin for Assignment<Job>where
Job: UnsafeUnpin,
impl<Job> UnwindSafe for Assignment<Job>where
Job: UnwindSafe,
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