pub struct TaskDef {
pub id: TaskId,
pub name: String,
pub schedule: Schedule,
pub config: TaskConfig,
pub enabled: bool,
pub hlc_timestamp: u64,
pub version: u64,
pub created_at: DateTime<Utc>,
pub updated_at: DateTime<Utc>,
}Expand description
Task definition - the blueprint for a scheduled task.
Fields§
§id: TaskIdUnique identifier.
name: StringHuman-readable name (must be unique).
schedule: ScheduleSchedule configuration.
config: TaskConfigTask configuration.
enabled: boolWhether the task is enabled.
hlc_timestamp: u64HLC timestamp for CRDT ordering.
version: u64Version number for optimistic locking.
created_at: DateTime<Utc>Creation time.
updated_at: DateTime<Utc>Last update time.
Implementations§
Source§impl TaskDef
impl TaskDef
Sourcepub fn with_config(self, config: TaskConfig) -> Self
pub fn with_config(self, config: TaskConfig) -> Self
Set the task configuration.
Sourcepub fn with_retry(self, retry: RetryPolicy) -> Self
pub fn with_retry(self, retry: RetryPolicy) -> Self
Set the retry policy.
Sourcepub fn with_timeout(self, timeout: Duration) -> Self
pub fn with_timeout(self, timeout: Duration) -> Self
Set the execution timeout.
Sourcepub fn with_payload(self, payload: Bytes) -> Self
pub fn with_payload(self, payload: Bytes) -> Self
Set the payload data.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for TaskDef
impl<'de> Deserialize<'de> for TaskDef
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 TaskDef
impl RefUnwindSafe for TaskDef
impl Send for TaskDef
impl Sync for TaskDef
impl Unpin for TaskDef
impl UnwindSafe for TaskDef
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