Skip to main content

Assignment

Struct Assignment 

Source
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>

Source

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

Borrow the execution payload without exposing pool correlation.

Source

pub fn complete<WorkerResult>( self, worker_result: WorkerResult, ) -> ReportToParent<Completion<WorkerResult>>

Consume the assignment and return one opaque completion to its pool.

Trait Implementations§

Source§

impl<Job> Debug for Assignment<Job>
where Job: Debug,

Source§

fn fmt(&self, formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

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