pub struct TaskAffinity {
pub preferred_workers: Vec<String>,
pub required_capabilities: Vec<String>,
pub requires_gpu: bool,
}Expand description
Task affinity for scheduling optimization
Fields§
§preferred_workers: Vec<String>Preferred worker IDs
required_capabilities: Vec<String>Required capabilities
requires_gpu: boolGPU requirement
Implementations§
Source§impl TaskAffinity
impl TaskAffinity
Sourcepub fn prefer_worker(self, worker_id: String) -> Self
pub fn prefer_worker(self, worker_id: String) -> Self
Add preferred worker
Sourcepub fn require_capability(self, capability: String) -> Self
pub fn require_capability(self, capability: String) -> Self
Add required capability
Sourcepub fn require_gpu(self, require: bool) -> Self
pub fn require_gpu(self, require: bool) -> Self
Set GPU requirement
Trait Implementations§
Source§impl Clone for TaskAffinity
impl Clone for TaskAffinity
Source§fn clone(&self) -> TaskAffinity
fn clone(&self) -> TaskAffinity
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for TaskAffinity
impl Debug for TaskAffinity
Auto Trait Implementations§
impl Freeze for TaskAffinity
impl RefUnwindSafe for TaskAffinity
impl Send for TaskAffinity
impl Sync for TaskAffinity
impl Unpin for TaskAffinity
impl UnsafeUnpin for TaskAffinity
impl UnwindSafe for TaskAffinity
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