pub struct WorkerRecord {
pub task_id: String,
pub workspace_path: PathBuf,
pub lifecycle: WorkerLifecycle,
pub started_at: String,
pub completed_at: Option<String>,
pub push_attempts: u32,
pub last_error: Option<String>,
}Expand description
A worker record tracking task execution and integration.
Fields§
§task_id: StringTask ID associated with this worker.
workspace_path: PathBufAbsolute path to the workspace directory.
lifecycle: WorkerLifecycleCurrent lifecycle state.
started_at: StringTimestamp when the worker was started (RFC3339).
completed_at: Option<String>Timestamp when the worker completed/failed (RFC3339).
push_attempts: u32Number of push attempts made.
last_error: Option<String>Last error message if failed/blocked.
Implementations§
Source§impl WorkerRecord
impl WorkerRecord
pub fn new( task_id: impl Into<String>, workspace_path: PathBuf, started_at: String, ) -> Self
Sourcepub fn start_integration(&mut self)
pub fn start_integration(&mut self)
Mark the worker as transitioning to integration phase.
Sourcepub fn mark_completed(&mut self, timestamp: String)
pub fn mark_completed(&mut self, timestamp: String)
Mark the worker as completed successfully.
Sourcepub fn mark_failed(&mut self, timestamp: String, error: impl Into<String>)
pub fn mark_failed(&mut self, timestamp: String, error: impl Into<String>)
Mark the worker as failed.
Sourcepub fn mark_blocked(&mut self, timestamp: String, error: impl Into<String>)
pub fn mark_blocked(&mut self, timestamp: String, error: impl Into<String>)
Mark the worker as blocked on push.
Sourcepub fn increment_push_attempt(&mut self)
pub fn increment_push_attempt(&mut self)
Increment push attempt counter.
Sourcepub fn is_terminal(&self) -> bool
pub fn is_terminal(&self) -> bool
Returns true if the worker is in a terminal state.
Trait Implementations§
Source§impl Clone for WorkerRecord
impl Clone for WorkerRecord
Source§fn clone(&self) -> WorkerRecord
fn clone(&self) -> WorkerRecord
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for WorkerRecord
impl Debug for WorkerRecord
Source§impl<'de> Deserialize<'de> for WorkerRecord
impl<'de> Deserialize<'de> for WorkerRecord
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 WorkerRecord
impl RefUnwindSafe for WorkerRecord
impl Send for WorkerRecord
impl Sync for WorkerRecord
impl Unpin for WorkerRecord
impl UnsafeUnpin for WorkerRecord
impl UnwindSafe for WorkerRecord
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