pub(crate) fn get_files(path: impl AsRef<Path>) -> Result<Vec<impl AsRef<Path>>>
Expand description
Finds all files matching the given glob pattern and returns their paths.
This function wraps the glob crate functionality with proper error handling
and converts the results to AsRef<Path>
instances. It’s used throughout
the application for discovering video segments, frame images, and other
generated files.
§Arguments
path
- A path pattern supporting glob wildcards (*, ?, [abc], etc.)
§Returns
Ok(Vec<impl AsRef<Path>>)
- Vector of matching file pathsErr
- If the pattern is invalid UTF-8 or glob matching fails
§Examples
let paths = get_files("frames/*.png")?; // Find all PNG frames
let segments = get_files("segments/*.mp4")?; // Find all MP4 segments