buildkit_llb/ops/fs/
path.rs1use std::path::{Path, PathBuf};
2
3use crate::utils::{OperationOutput, OwnOutputIdx};
4
5#[derive(Debug)]
7pub struct UnsetPath;
8
9#[derive(Debug)]
11pub enum LayerPath<'a, P: AsRef<Path>> {
12 Own(OwnOutputIdx, P),
14
15 Other(OperationOutput<'a>, P),
17
18 Scratch(P),
20}
21
22impl<'a, P: AsRef<Path>> LayerPath<'a, P> {
23 pub fn into_owned(self) -> LayerPath<'a, PathBuf> {
25 use LayerPath::*;
26
27 match self {
28 Other(input, path) => Other(input, path.as_ref().into()),
29 Own(output, path) => Own(output, path.as_ref().into()),
30 Scratch(path) => Scratch(path.as_ref().into()),
31 }
32 }
33}