pub struct ProxyStatusTracker { /* private fields */ }Expand description
Tracker that manages multiple proxy job statuses.
Implementations§
Source§impl ProxyStatusTracker
impl ProxyStatusTracker
Sourcepub fn add_job(&mut self, status: ProxyJobStatus)
pub fn add_job(&mut self, status: ProxyJobStatus)
Register a new job.
Sourcepub fn get_job(&self, job_id: &str) -> Option<&ProxyJobStatus>
pub fn get_job(&self, job_id: &str) -> Option<&ProxyJobStatus>
Get the status of a specific job.
Sourcepub fn transition(&mut self, job_id: &str, new_state: ProxyState) -> bool
pub fn transition(&mut self, job_id: &str, new_state: ProxyState) -> bool
Transition a job to a new state.
Sourcepub fn fail_job(&mut self, job_id: &str, error: &str) -> bool
pub fn fail_job(&mut self, job_id: &str, error: &str) -> bool
Record a failure with an error message.
Sourcepub fn update_progress(&mut self, job_id: &str, frames: u64) -> bool
pub fn update_progress(&mut self, job_id: &str, frames: u64) -> bool
Update frame progress on a job.
Sourcepub fn count_by_state(&self) -> HashMap<ProxyState, usize>
pub fn count_by_state(&self) -> HashMap<ProxyState, usize>
Return a count of jobs by state.
Sourcepub fn overall_progress(&self) -> f64
pub fn overall_progress(&self) -> f64
Return the overall progress across all non-terminal jobs.
Sourcepub fn retryable_jobs(&self) -> Vec<&ProxyJobStatus>
pub fn retryable_jobs(&self) -> Vec<&ProxyJobStatus>
Return all jobs that are in the Failed state and can be retried.
Sourcepub fn clear_terminal(&mut self) -> usize
pub fn clear_terminal(&mut self) -> usize
Remove all jobs that are in a terminal state.
Trait Implementations§
Source§impl Debug for ProxyStatusTracker
impl Debug for ProxyStatusTracker
Auto Trait Implementations§
impl Freeze for ProxyStatusTracker
impl RefUnwindSafe for ProxyStatusTracker
impl Send for ProxyStatusTracker
impl Sync for ProxyStatusTracker
impl Unpin for ProxyStatusTracker
impl UnsafeUnpin for ProxyStatusTracker
impl UnwindSafe for ProxyStatusTracker
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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