]> git.r.bdr.sh - rbdr/page/blob - src/file_handler/file_strategies/file.rs
530bbd6ebd746cecbd6f1f355cbc3f4fe62d31dd
[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::{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, path: &PathBuf) -> bool {
17 !path.is_dir()
18 }
19
20 fn handle(&self, path: &PathBuf) {
21 println!("Should copy {}", path.display())
22 }
23 }