pub struct Job {
pub id: u64,
pub weight: f64,
pub remaining_time: f64,
pub total_time: f64,
pub arrival_time: f64,
pub arrival_seq: u64,
pub estimate_source: EstimateSource,
pub weight_source: WeightSource,
pub name: Option<String>,
}Expand description
A job in the queue.
Fields§
§id: u64Unique job identifier.
weight: f64Job weight (importance). Higher = more priority.
remaining_time: f64Estimated remaining processing time.
total_time: f64Original estimated total time.
arrival_time: f64Time when job was submitted.
arrival_seq: u64Monotonic arrival sequence (tie-breaker).
estimate_source: EstimateSourceSource of processing-time estimate.
weight_source: WeightSourceSource of weight/importance.
name: Option<String>Optional job name for debugging.
Implementations§
Source§impl Job
impl Job
Sourcepub fn new(id: u64, weight: f64, estimated_time: f64) -> Self
pub fn new(id: u64, weight: f64, estimated_time: f64) -> Self
Create a new job with given ID, weight, and estimated time.
Sourcepub fn with_name(
id: u64,
weight: f64,
estimated_time: f64,
name: impl Into<String>,
) -> Self
pub fn with_name( id: u64, weight: f64, estimated_time: f64, name: impl Into<String>, ) -> Self
Create a job with a name.
Sourcepub fn with_sources(
self,
weight_source: WeightSource,
estimate_source: EstimateSource,
) -> Self
pub fn with_sources( self, weight_source: WeightSource, estimate_source: EstimateSource, ) -> Self
Set estimate and weight sources.
Sourcepub fn is_complete(&self) -> bool
pub fn is_complete(&self) -> bool
Is the job complete?
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Job
impl RefUnwindSafe for Job
impl Send for Job
impl Sync for Job
impl Unpin for Job
impl UnwindSafe for Job
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