use crate::config::Config; use crate::repository::Repository; pub struct Transcoder { config: Config, repository: Repository, } impl Transcoder { pub fn new(config: Config, repository: Repository) -> Transcoder { return Transcoder{ config: config, repository: repository, } } pub fn start(self) { println!("Starting transcoder..."); // search for files in ingest let ingest_files = self.repository.search_ingest(); for i in ingest_files { // copy the file to the archive self.repository.archive_file(&i); // perform the video transcode // TODO - self.transcode(i); // remove the source file self.repository.cleanup_file(&i); } } }