pub struct StormWorker {
pub id: String,
pub total_slots: u32,
pub speed: f64,
pub eligibility: WorkerEligibility,
}Expand description
A worker in the simulated fleet.
Fields§
§id: StringStable worker id.
total_slots: u32Total concurrent slots.
speed: f64SpeedScore used in fairness weighting (higher = faster).
eligibility: WorkerEligibilityLive eligibility.
Implementations§
Source§impl StormWorker
impl StormWorker
Sourcepub fn healthy(id: impl Into<String>, total_slots: u32, speed: f64) -> Self
pub fn healthy(id: impl Into<String>, total_slots: u32, speed: f64) -> Self
A healthy worker with the given id, slots, and speed.
Sourcepub fn with_eligibility(self, eligibility: WorkerEligibility) -> Self
pub fn with_eligibility(self, eligibility: WorkerEligibility) -> Self
The same worker with a different eligibility (for building adversarial fleets where some workers must never receive work).
Trait Implementations§
Source§impl Clone for StormWorker
impl Clone for StormWorker
Source§impl Debug for StormWorker
impl Debug for StormWorker
Source§impl PartialEq for StormWorker
impl PartialEq for StormWorker
impl StructuralPartialEq for StormWorker
Auto Trait Implementations§
impl Freeze for StormWorker
impl RefUnwindSafe for StormWorker
impl Send for StormWorker
impl Sync for StormWorker
impl Unpin for StormWorker
impl UnsafeUnpin for StormWorker
impl UnwindSafe for StormWorker
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