pub struct WorkItem<T> {
pub id: u64,
pub payload: T,
pub priority: u8,
pub enqueued_at: Instant,
}Expand description
A unit of work submitted to the pool.
This is a public-facing view of a queued item. The pool infers all fields
internally; callers interact with work items only via WorkerPool::submit.
Fields§
§id: u64Monotonically increasing submission identifier.
payload: TThe caller-supplied payload.
priority: u8Higher values are more urgent (0 = normal).
enqueued_at: InstantWall-clock time at which the item was enqueued.
Auto Trait Implementations§
impl<T> Freeze for WorkItem<T>where
T: Freeze,
impl<T> RefUnwindSafe for WorkItem<T>where
T: RefUnwindSafe,
impl<T> Send for WorkItem<T>where
T: Send,
impl<T> Sync for WorkItem<T>where
T: Sync,
impl<T> Unpin for WorkItem<T>where
T: Unpin,
impl<T> UnsafeUnpin for WorkItem<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for WorkItem<T>where
T: 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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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>
Wrap the input message
T in a tonic::Request