]> git.r.bdr.sh - rbdr/page/blob - src/file_handler/file_strategies/file.rs
b1de596f110e70060b89517f09a8969714b1d341
[rbdr/page] / src / file_handler / file_strategies / file.rs
1 pub struct Strategy {}
2
3 use std::path::PathBuf;
4
5 use crate::file_handler::{File, FileType, FileHandlerStrategy};
6
7 impl FileHandlerStrategy for Strategy {
8 fn is(&self, path: &PathBuf) -> bool {
9 !path.is_dir()
10 }
11
12 fn identify(&self) -> FileType {
13 FileType::File
14 }
15
16 fn can_handle(&self, file_type: &FileType) -> bool {
17 match file_type {
18 FileType::File => true,
19 _ => false,
20 }
21 }
22
23 fn handle(&self, file: &File) {
24 println!("Should copy {}", file.path.display())
25 }
26 }