pub enum Source {
HostDir(PathBuf),
TarArchive {
path: PathBuf,
codec: Option<Algo>,
},
Image(Target),
Layered(Vec<Source>),
}Expand description
Where to draw a filesystem’s contents from when building or populating it. See module docs.
Variants§
HostDir(PathBuf)
A directory on the host filesystem, walked recursively.
TarArchive
A tar archive on disk, plain or compressed.
Image(Target)
An existing image, optionally with a :N partition selector.
Layered(Vec<Source>)
Multiple sources stacked bottom→top. Upper layers override
files of the same path; tombstones (.wh.* files, character
device 0/0) delete paths from lower layers. See
crate::merge for the fold semantics.
Implementations§
Source§impl Source
impl Source
Sourcepub fn detect(spec: &str) -> Result<Self>
pub fn detect(spec: &str) -> Result<Self>
Auto-detect what kind of source spec points at.
a+b+c(+-separated specs) →Layered, applied bottom→top.- An existing directory path →
HostDir. - A recognised tar extension (
.tar,.tar.gz,.tgz,.tar.xz,.txz,.tar.zst,.tar.lz4,.tar.lzma,.tar.lzo) →TarArchive. - Anything else, including a
path:Npartition selector →Image. Parsed bycrate::inspect::Target::parse.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Source
impl RefUnwindSafe for Source
impl Send for Source
impl Sync for Source
impl Unpin for Source
impl UnsafeUnpin for Source
impl UnwindSafe for Source
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more