pub struct TaskBuilder { /* private fields */ }Expand description
Task builder for convenient task creation
Implementations§
Source§impl TaskBuilder
impl TaskBuilder
Sourcepub fn description(self, description: String) -> Self
pub fn description(self, description: String) -> Self
Set task description
Sourcepub fn priority(self, priority: TaskPriority) -> Self
pub fn priority(self, priority: TaskPriority) -> Self
Set task priority
Sourcepub fn estimated_duration(self, duration: Duration) -> Self
pub fn estimated_duration(self, duration: Duration) -> Self
Set estimated duration
Sourcepub fn deadline(self, deadline: SystemTime) -> Self
pub fn deadline(self, deadline: SystemTime) -> Self
Set task deadline
Sourcepub fn dependency(self, task_id: String) -> Self
pub fn dependency(self, task_id: String) -> Self
Add dependency
Sourcepub fn memory_bytes(self, bytes: u64) -> Self
pub fn memory_bytes(self, bytes: u64) -> Self
Set memory requirements
Sourcepub fn disk_bytes(self, bytes: u64) -> Self
pub fn disk_bytes(self, bytes: u64) -> Self
Set disk requirements
Sourcepub fn network_bandwidth(self, bandwidth: u64) -> Self
pub fn network_bandwidth(self, bandwidth: u64) -> Self
Set network bandwidth requirements
Sourcepub fn gpu_memory_bytes(self, bytes: u64) -> Self
pub fn gpu_memory_bytes(self, bytes: u64) -> Self
Set GPU memory requirements
Sourcepub fn parameter<K: Into<String>>(self, key: K, value: ConfigValue) -> Self
pub fn parameter<K: Into<String>>(self, key: K, value: ConfigValue) -> Self
Add configuration parameter
Sourcepub fn environment<K: Into<String>, V: Into<String>>(
self,
key: K,
value: V,
) -> Self
pub fn environment<K: Into<String>, V: Into<String>>( self, key: K, value: V, ) -> Self
Add environment variable
Sourcepub fn working_directory<P: Into<String>>(self, path: P) -> Self
pub fn working_directory<P: Into<String>>(self, path: P) -> Self
Set working directory
Sourcepub fn build(self) -> ExecutionTask
pub fn build(self) -> ExecutionTask
Build the task
Auto Trait Implementations§
impl Freeze for TaskBuilder
impl !RefUnwindSafe for TaskBuilder
impl Send for TaskBuilder
impl Sync for TaskBuilder
impl Unpin for TaskBuilder
impl !UnwindSafe for TaskBuilder
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> 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