pub struct AffinityScore;Expand description
Computes affinity scores between workers and tasks.
Implementations§
Source§impl AffinityScore
impl AffinityScore
Sourcepub fn compute(
capability: &WorkerCapability,
requirements: &TaskRequirements,
) -> f32
pub fn compute( capability: &WorkerCapability, requirements: &TaskRequirements, ) -> f32
Compute a 0.0–1.0 affinity score.
Scoring:
- Returns 0.0 if mandatory minimums are not met.
- Base score of 0.5 when all minimums are met.
- +0.1 for each preferred tag match (capped so total <= 1.0).
- +0.3 if GPU is required and available with sufficient VRAM.
Auto Trait Implementations§
impl Freeze for AffinityScore
impl RefUnwindSafe for AffinityScore
impl Send for AffinityScore
impl Sync for AffinityScore
impl Unpin for AffinityScore
impl UnsafeUnpin for AffinityScore
impl UnwindSafe for AffinityScore
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> 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