pub struct Workload {
pub id: String,
pub name: String,
pub namespace: String,
pub resources: ResourceRequirements,
pub priority: i32,
pub priority_class: Option<String>,
pub constraints: Vec<PlacementConstraint>,
pub affinity: Option<Affinity>,
pub tolerations: Vec<Toleration>,
pub preemption_policy: PreemptionPolicy,
pub created_at: DateTime<Utc>,
}Expand description
Workload to be scheduled
Fields§
§id: StringUnique workload ID
name: StringWorkload name
namespace: StringNamespace
resources: ResourceRequirementsResource requirements
priority: i32Priority (higher = more important)
priority_class: Option<String>Priority class name
constraints: Vec<PlacementConstraint>Placement constraints
affinity: Option<Affinity>Node affinity rules
tolerations: Vec<Toleration>Tolerations for taints
preemption_policy: PreemptionPolicyPreemption policy
created_at: DateTime<Utc>Creation timestamp
Implementations§
Source§impl Workload
impl Workload
Sourcepub fn with_resources(self, resources: ResourceRequirements) -> Self
pub fn with_resources(self, resources: ResourceRequirements) -> Self
Set resource requirements
Sourcepub fn with_priority(self, priority: i32) -> Self
pub fn with_priority(self, priority: i32) -> Self
Set priority
Sourcepub fn with_constraint(self, constraint: PlacementConstraint) -> Self
pub fn with_constraint(self, constraint: PlacementConstraint) -> Self
Add constraint
Sourcepub fn with_affinity(self, affinity: Affinity) -> Self
pub fn with_affinity(self, affinity: Affinity) -> Self
Set affinity
Sourcepub fn with_toleration(self, toleration: Toleration) -> Self
pub fn with_toleration(self, toleration: Toleration) -> Self
Add toleration
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Workload
impl<'de> Deserialize<'de> for Workload
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for Workload
impl RefUnwindSafe for Workload
impl Send for Workload
impl Sync for Workload
impl Unpin for Workload
impl UnwindSafe for Workload
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more