pub struct Task {
pub id: String,
pub name: String,
pub payload: Vec<u8>,
pub priority: TaskPriority,
pub timeout: Option<Duration>,
pub dependencies: Vec<String>,
pub retry_count: usize,
pub maxretries: usize,
pub created_at: Instant,
pub status: TaskStatus,
}
Expand description
Task definition for orchestration
Fields§
§id: String
§name: String
§payload: Vec<u8>
§priority: TaskPriority
§timeout: Option<Duration>
§dependencies: Vec<String>
§retry_count: usize
§maxretries: usize
§created_at: Instant
§status: TaskStatus
Implementations§
Source§impl Task
impl Task
Sourcepub fn with_priority(self, priority: TaskPriority) -> Self
pub fn with_priority(self, priority: TaskPriority) -> Self
Set task priority
Sourcepub fn with_timeout(self, timeout: Duration) -> Self
pub fn with_timeout(self, timeout: Duration) -> Self
Set task timeout
Sourcepub fn with_dependencies(self, dependencies: Vec<String>) -> Self
pub fn with_dependencies(self, dependencies: Vec<String>) -> Self
Add task dependencies
Sourcepub fn increment_retry(&mut self)
pub fn increment_retry(&mut self)
Increment retry count
Sourcepub fn has_timed_out(&self) -> bool
pub fn has_timed_out(&self) -> bool
Check if task has timed out
Trait Implementations§
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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