pub struct JobQueue { /* private fields */ }Expand description
Job queue for managing multiple transcode jobs.
Implementations§
Source§impl JobQueue
impl JobQueue
Sourcepub fn enqueue(&mut self, job: TranscodeJob)
pub fn enqueue(&mut self, job: TranscodeJob)
Adds a job to the queue.
Sourcepub fn dequeue(&mut self) -> Option<TranscodeJob>
pub fn dequeue(&mut self) -> Option<TranscodeJob>
Gets the next job to execute.
Sourcepub fn running_count(&self) -> usize
pub fn running_count(&self) -> usize
Gets the number of running jobs.
Sourcepub fn queued_count(&self) -> usize
pub fn queued_count(&self) -> usize
Gets the number of queued jobs.
Sourcepub fn cancel_job(&mut self, job_id: &str) -> Result<()>
pub fn cancel_job(&mut self, job_id: &str) -> Result<()>
Cancels a job by ID.
Sourcepub fn get_job(&self, job_id: &str) -> Option<&TranscodeJob>
pub fn get_job(&self, job_id: &str) -> Option<&TranscodeJob>
Gets a job by ID.
Sourcepub fn clear_finished(&mut self)
pub fn clear_finished(&mut self)
Clears completed and failed jobs.
Auto Trait Implementations§
impl Freeze for JobQueue
impl RefUnwindSafe for JobQueue
impl Send for JobQueue
impl Sync for JobQueue
impl Unpin for JobQueue
impl UnsafeUnpin for JobQueue
impl UnwindSafe for JobQueue
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> 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