]> git.r.bdr.sh - rbdr/page/blame - src/file_handler/file_strategies/file.rs
Add logic to read and assign files / layout
[rbdr/page] / src / file_handler / file_strategies / file.rs
CommitLineData
1e2d00b6
RBR
1pub struct Strategy {}
2
3use std::path::PathBuf;
4
4fd89b80 5use crate::file_handler::{File, FileType, FileHandlerStrategy};
1e2d00b6
RBR
6
7impl 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
4fd89b80
RBR
16 fn can_handle(&self, file_type: &FileType) -> bool {
17 match file_type {
18 FileType::File => true,
19 _ => false,
20 }
1e2d00b6
RBR
21 }
22
4fd89b80
RBR
23 fn handle(&self, file: &File) {
24 println!("Should copy {}", file.path.display())
1e2d00b6
RBR
25 }
26}