pub struct Task<D> {
pub task_id: Uuid,
pub data: D,
pub started: DateTime<Utc>,
pub finished: Option<DateTime<Utc>>,
pub retries: u32,
pub error_msg: Option<String>,
}
Expand description
A Task
struct represents a single unit of work that will be processed
by a worker. It contains data of type D
, which is used by the worker
during processing. The Task
struct also includes fields for managing
the task’s lifecycle, including the task’s UUID, the start and
finish times, the number of retries, and any error messages.
Fields§
§task_id: Uuid
§data: D
§started: DateTime<Utc>
§finished: Option<DateTime<Utc>>
§retries: u32
§error_msg: Option<String>
Implementations§
Trait Implementations§
Source§impl<'de, D> Deserialize<'de> for Task<D>where
D: Deserialize<'de>,
impl<'de, D> Deserialize<'de> for Task<D>where
D: Deserialize<'de>,
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<D> Freeze for Task<D>where
D: Freeze,
impl<D> RefUnwindSafe for Task<D>where
D: RefUnwindSafe,
impl<D> Send for Task<D>where
D: Send,
impl<D> Sync for Task<D>where
D: Sync,
impl<D> Unpin for Task<D>where
D: Unpin,
impl<D> UnwindSafe for Task<D>where
D: UnwindSafe,
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