pub struct Strategy {} use std::path::PathBuf; use crate::file_handler::{FileType, FileHandlerStrategy}; impl FileHandlerStrategy for Strategy { fn is(&self, path: &PathBuf) -> bool { if let Some(extension) = path.extension() { return !path.is_dir() && extension == "gmi" } false } fn identify(&self) -> FileType { FileType::Gemini } fn can_handle(&self, path: &PathBuf) -> bool { self.is(path) } fn handle(&self, path: &PathBuf) { println!("Should convert {}", path.display()) } }