pub struct TranscodeSession {
pub id: u64,
pub input_path: String,
pub output_path: String,
pub state: SessionState,
pub start_ms: u64,
pub end_ms: u64,
pub total_duration_ms: u64,
/* private fields */
}Expand description
A transcode session representing one input-to-output operation.
Fields§
§id: u64Unique session identifier.
input_path: StringInput file path.
output_path: StringOutput file path.
state: SessionStateCurrent state of the session.
start_ms: u64Start time in milliseconds since epoch (0 if not started).
end_ms: u64End time in milliseconds since epoch (0 if not finished).
total_duration_ms: u64Total duration of the input in milliseconds.
Implementations§
Source§impl TranscodeSession
impl TranscodeSession
Sourcepub fn new(
id: u64,
input_path: impl Into<String>,
output_path: impl Into<String>,
total_duration_ms: u64,
) -> Self
pub fn new( id: u64, input_path: impl Into<String>, output_path: impl Into<String>, total_duration_ms: u64, ) -> Self
Creates a new session in the Pending state.
Sourcepub fn set_progress(&mut self, pct: f64)
pub fn set_progress(&mut self, pct: f64)
Updates the progress (clamped to [0.0, 1.0]).
Sourcepub fn elapsed_ms(&self, now_ms: u64) -> u64
pub fn elapsed_ms(&self, now_ms: u64) -> u64
Returns elapsed time in milliseconds (0 if not started, uses end_ms if terminal).
Sourcepub fn progress_pct(&self) -> f64
pub fn progress_pct(&self) -> f64
Returns progress as a percentage (0–100).
Trait Implementations§
Source§impl Clone for TranscodeSession
impl Clone for TranscodeSession
Source§fn clone(&self) -> TranscodeSession
fn clone(&self) -> TranscodeSession
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 moreAuto Trait Implementations§
impl Freeze for TranscodeSession
impl RefUnwindSafe for TranscodeSession
impl Send for TranscodeSession
impl Sync for TranscodeSession
impl Unpin for TranscodeSession
impl UnsafeUnpin for TranscodeSession
impl UnwindSafe for TranscodeSession
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