use crate::{file::FileOp, plugin::PluginOp, prework::PreworkOp}; #[derive(Debug)] pub enum TaskOp { File(Box), Plugin(Box), Prework(Box), } impl TaskOp { pub fn id(&self) -> usize { match self { TaskOp::File(op) => op.id(), TaskOp::Plugin(op) => op.id(), TaskOp::Prework(op) => op.id(), } } } impl From for TaskOp { fn from(op: FileOp) -> Self { Self::File(Box::new(op)) } } impl From for TaskOp { fn from(op: PluginOp) -> Self { Self::Plugin(Box::new(op)) } } impl From for TaskOp { fn from(op: PreworkOp) -> Self { Self::Prework(Box::new(op)) } }