pub struct SegmentTranscoder {
pub segments: Vec<TranscodeSegment>,
pub workers: u32,
}Expand description
Orchestrates multi-segment transcoding with configurable worker concurrency.
Fields§
§segments: Vec<TranscodeSegment>All queued segments.
workers: u32Number of parallel worker threads to use.
Implementations§
Source§impl SegmentTranscoder
impl SegmentTranscoder
Sourcepub fn new(workers: u32) -> Self
pub fn new(workers: u32) -> Self
Creates a new transcoder with a specified worker count.
§Panics
Does not panic; workers must be at least 1 (caller responsibility).
Sourcepub fn queue_segment(
&mut self,
spec: SegmentSpec,
input: impl Into<String>,
output: impl Into<String>,
)
pub fn queue_segment( &mut self, spec: SegmentSpec, input: impl Into<String>, output: impl Into<String>, )
Queues a new segment for transcoding.
Sourcepub fn pending_count(&self) -> usize
pub fn pending_count(&self) -> usize
Returns the number of segments still waiting to be processed.
Sourcepub fn complete_count(&self) -> usize
pub fn complete_count(&self) -> usize
Returns the number of successfully completed segments.
Sourcepub fn failed_segments(&self) -> Vec<&TranscodeSegment>
pub fn failed_segments(&self) -> Vec<&TranscodeSegment>
Returns references to all segments that have failed.
Sourcepub fn total_duration_ms(&self) -> u64
pub fn total_duration_ms(&self) -> u64
Returns the sum of all segment durations in milliseconds.
Sourcepub fn segment_count(&self) -> usize
pub fn segment_count(&self) -> usize
Returns the total number of queued segments.
Sourcepub fn encoding_count(&self) -> usize
pub fn encoding_count(&self) -> usize
Returns the number of segments currently encoding.
Sourcepub fn overall_progress_pct(&self) -> u8
pub fn overall_progress_pct(&self) -> u8
Returns the overall progress across all segments as a percentage (0–100).
Trait Implementations§
Source§impl Clone for SegmentTranscoder
impl Clone for SegmentTranscoder
Source§fn clone(&self) -> SegmentTranscoder
fn clone(&self) -> SegmentTranscoder
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 SegmentTranscoder
impl Debug for SegmentTranscoder
Auto Trait Implementations§
impl Freeze for SegmentTranscoder
impl RefUnwindSafe for SegmentTranscoder
impl Send for SegmentTranscoder
impl Sync for SegmentTranscoder
impl Unpin for SegmentTranscoder
impl UnsafeUnpin for SegmentTranscoder
impl UnwindSafe for SegmentTranscoder
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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