pub struct WatchConfig {
pub watch_dir: PathBuf,
pub accepted_extensions: Vec<String>,
pub output_location: OutputLocation,
pub on_success: PostProcessAction,
pub on_failure: PostProcessAction,
pub poll_interval_ms: u64,
pub base_config: TranscodeConfig,
pub max_concurrent: usize,
}Expand description
Configuration for TranscodeWatcher.
Fields§
§watch_dir: PathBufDirectory to monitor for incoming files.
accepted_extensions: Vec<String>File extensions to accept (lower-case, without leading dot).
output_location: OutputLocationHow to determine the output path for each new file.
on_success: PostProcessActionWhat to do with an input file after a successful transcode.
on_failure: PostProcessActionWhat to do with an input file after a failed transcode.
poll_interval_ms: u64How often to scan the watch directory (milliseconds).
base_config: TranscodeConfigBase TranscodeConfig applied to every discovered file.
max_concurrent: usizeMaximum number of concurrent jobs.
Implementations§
Source§impl WatchConfig
impl WatchConfig
Sourcepub fn new(watch_dir: impl Into<PathBuf>) -> Self
pub fn new(watch_dir: impl Into<PathBuf>) -> Self
Creates a WatchConfig with sensible defaults.
Accepts common video extensions, moves successful files to done/,
and polls every 5 seconds.
Sourcepub fn output_location(self, loc: OutputLocation) -> Self
pub fn output_location(self, loc: OutputLocation) -> Self
Sets the output location policy.
Sourcepub fn on_success(self, action: PostProcessAction) -> Self
pub fn on_success(self, action: PostProcessAction) -> Self
Sets what happens to the source file after a successful transcode.
Sourcepub fn on_failure(self, action: PostProcessAction) -> Self
pub fn on_failure(self, action: PostProcessAction) -> Self
Sets what happens to the source file after a failed transcode.
Sourcepub fn poll_interval_ms(self, ms: u64) -> Self
pub fn poll_interval_ms(self, ms: u64) -> Self
Sets the polling interval in milliseconds.
Sourcepub fn base_config(self, config: TranscodeConfig) -> Self
pub fn base_config(self, config: TranscodeConfig) -> Self
Overrides the base TranscodeConfig.
Sourcepub fn max_concurrent(self, n: usize) -> Self
pub fn max_concurrent(self, n: usize) -> Self
Sets the maximum number of concurrent jobs.
Trait Implementations§
Source§impl Clone for WatchConfig
impl Clone for WatchConfig
Source§fn clone(&self) -> WatchConfig
fn clone(&self) -> WatchConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for WatchConfig
impl RefUnwindSafe for WatchConfig
impl Send for WatchConfig
impl Sync for WatchConfig
impl Unpin for WatchConfig
impl UnsafeUnpin for WatchConfig
impl UnwindSafe for WatchConfig
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
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>
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