pub struct Task {
pub name: String,
pub driver: Driver,
pub command: Option<String>,
pub args: Vec<String>,
pub env: HashMap<String, String>,
pub resources: Resources,
pub artifacts: Vec<String>,
pub health_check: Option<HealthCheck>,
pub metadata: HashMap<String, String>,
}Expand description
Individual task within a task group
Fields§
§name: StringTask name
driver: DriverExecution driver
command: Option<String>Command to execute
args: Vec<String>Command arguments
env: HashMap<String, String>Environment variables
resources: ResourcesResource requirements
artifacts: Vec<String>Artifact URLs to download
health_check: Option<HealthCheck>Health check configuration
metadata: HashMap<String, String>Task metadata
Implementations§
Source§impl Task
impl Task
Sourcepub fn env(self, key: impl Into<String>, value: impl Into<String>) -> Self
pub fn env(self, key: impl Into<String>, value: impl Into<String>) -> Self
Add an environment variable
Sourcepub fn resources(self, cpu: u32, memory: u32) -> Self
pub fn resources(self, cpu: u32, memory: u32) -> Self
Set resource requirements (CPU MHz, Memory MB)
Sourcepub fn with_resources(self, resources: Resources) -> Self
pub fn with_resources(self, resources: Resources) -> Self
Set full resource configuration
Sourcepub fn health_check(self, check: HealthCheck) -> Self
pub fn health_check(self, check: HealthCheck) -> Self
Set health check
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Task
impl<'de> Deserialize<'de> for Task
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 Task
impl RefUnwindSafe for Task
impl Send for Task
impl Sync for Task
impl Unpin for Task
impl UnwindSafe for Task
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