pub struct TaskContext {
pub task_id: TaskId,
pub worker_id: String,
pub memory_limit: u64,
pub num_cores: usize,
}Expand description
Task execution context with metadata.
Fields§
§task_id: TaskIdTask identifier.
worker_id: StringWorker identifier executing this task.
memory_limit: u64Total memory available (bytes).
num_cores: usizeNumber of CPU cores available.
Implementations§
Source§impl TaskContext
impl TaskContext
Sourcepub fn with_memory_limit(self, limit: u64) -> Self
pub fn with_memory_limit(self, limit: u64) -> Self
Set the memory limit.
Sourcepub fn with_num_cores(self, cores: usize) -> Self
pub fn with_num_cores(self, cores: usize) -> Self
Set the number of cores.
Trait Implementations§
Source§impl Clone for TaskContext
impl Clone for TaskContext
Source§fn clone(&self) -> TaskContext
fn clone(&self) -> TaskContext
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for TaskContext
impl RefUnwindSafe for TaskContext
impl Send for TaskContext
impl Sync for TaskContext
impl Unpin for TaskContext
impl UnsafeUnpin for TaskContext
impl UnwindSafe for TaskContext
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
Wrap the input message
T in a tonic::Request