pub struct ParallelStateFile {
pub schema_version: u32,
pub started_at: String,
pub target_branch: String,
pub workers: Vec<WorkerRecord>,
}Expand description
Parallel state file for direct-push mode.
Fields§
§schema_version: u32Schema version for migration compatibility.
started_at: StringTimestamp when the parallel run started (RFC3339).
target_branch: StringTarget branch for direct pushes.
workers: Vec<WorkerRecord>Active workers (one per task ID).
Implementations§
Source§impl ParallelStateFile
impl ParallelStateFile
pub fn new( started_at: impl Into<String>, target_branch: impl Into<String>, ) -> Self
Sourcepub fn upsert_worker(&mut self, record: WorkerRecord)
pub fn upsert_worker(&mut self, record: WorkerRecord)
Upsert a worker record. Replaces existing if task_id matches.
Sourcepub fn remove_worker(&mut self, task_id: &str)
pub fn remove_worker(&mut self, task_id: &str)
Remove a worker by task_id.
Sourcepub fn get_worker(&self, task_id: &str) -> Option<&WorkerRecord>
pub fn get_worker(&self, task_id: &str) -> Option<&WorkerRecord>
Get a worker by task_id.
Sourcepub fn get_worker_mut(&mut self, task_id: &str) -> Option<&mut WorkerRecord>
pub fn get_worker_mut(&mut self, task_id: &str) -> Option<&mut WorkerRecord>
Get a mutable worker by task_id.
Sourcepub fn has_worker(&self, task_id: &str) -> bool
pub fn has_worker(&self, task_id: &str) -> bool
Returns true if there’s a worker for this task_id.
Sourcepub fn workers_by_lifecycle(
&self,
lifecycle: WorkerLifecycle,
) -> impl Iterator<Item = &WorkerRecord>
pub fn workers_by_lifecycle( &self, lifecycle: WorkerLifecycle, ) -> impl Iterator<Item = &WorkerRecord>
Get all workers in a specific lifecycle state.
Sourcepub fn active_worker_count(&self) -> usize
pub fn active_worker_count(&self) -> usize
Count workers that are not in a terminal state.
Sourcepub fn blocked_worker_count(&self) -> usize
pub fn blocked_worker_count(&self) -> usize
Count workers in the blocked_push state.
Trait Implementations§
Source§impl Clone for ParallelStateFile
impl Clone for ParallelStateFile
Source§fn clone(&self) -> ParallelStateFile
fn clone(&self) -> ParallelStateFile
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 ParallelStateFile
impl Debug for ParallelStateFile
Source§impl<'de> Deserialize<'de> for ParallelStateFile
impl<'de> Deserialize<'de> for ParallelStateFile
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 ParallelStateFile
impl RefUnwindSafe for ParallelStateFile
impl Send for ParallelStateFile
impl Sync for ParallelStateFile
impl Unpin for ParallelStateFile
impl UnsafeUnpin for ParallelStateFile
impl UnwindSafe for ParallelStateFile
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