use std::path::{Path, PathBuf};
use crate::utils::{OperationOutput, OwnOutputIdx};
#[derive(Debug)]
pub struct UnsetPath;
#[derive(Debug)]
pub enum LayerPath<'a, P: AsRef<Path>> {
Own(OwnOutputIdx, P),
Other(OperationOutput<'a>, P),
Scratch(P),
}
impl<'a, P: AsRef<Path>> LayerPath<'a, P> {
pub fn into_owned(self) -> LayerPath<'a, PathBuf> {
use LayerPath::*;
match self {
Other(input, path) => Other(input, path.as_ref().into()),
Own(output, path) => Own(output, path.as_ref().into()),
Scratch(path) => Scratch(path.as_ref().into()),
}
}
}