pub struct ImportTarget<'a> { /* private fields */ }Expand description
The directory an import writes into, and whether it has been asked to stop.
Handed to an ImportFormat by
ProjectImporter, and the counterpart of the
PackPlan a format is handed to write: the resolved
description of the job, which the format reads and does not change. The
directories it names already exist.
Implementations§
Source§impl<'a> ImportTarget<'a>
impl<'a> ImportTarget<'a>
Sourcepub fn output_dir(&self) -> &'a Utf8Path
pub fn output_dir(&self) -> &'a Utf8Path
The project directory being written, which exists.
Sourcepub fn content_dir(&self) -> Utf8PathBuf
pub fn content_dir(&self) -> Utf8PathBuf
The directory every layer’s content sits under, content/.
Only the base layer’s is created up front; a format writing another layer creates it.
Sourcepub fn base_layer_dir(&self) -> Utf8PathBuf
pub fn base_layer_dir(&self) -> Utf8PathBuf
The base layer’s content directory, content/base/, which exists.
Created whatever the archive holds, because a project whose base layer
has no directory is one ProjectPacker refuses,
and an archive carrying metadata alone would otherwise import into one.
Sourcepub fn is_cancelled(&self) -> bool
pub fn is_cancelled(&self) -> bool
Whether the caller has asked the import to stop.
A format checks this between its steps and fails with its own cancelled
error, which the driver folds into
ImportError::Cancelled.
Sourcepub fn cancellation(&self) -> Cancellation<'a>
pub fn cancellation(&self) -> Cancellation<'a>
The cancellation, for handing to something that takes one of its own.