Struct omicron_zone_package::package::Package
source · [−]pub struct Package {
pub service_name: String,
pub source: PackageSource,
pub output: PackageOutput,
pub only_for_targets: Option<BTreeMap<String, String>>,
pub setup_hint: Option<String>,
}Expand description
A single package.
Fields
service_name: StringThe name of the service name to be used on the target OS.
source: PackageSourceIdentifies from where the package originates.
For example, do we need to assemble it ourselves, or pull it from somewhere else?
output: PackageOutputIdentifies what the output of the package should be.
only_for_targets: Option<BTreeMap<String, String>>Identifies the targets for which the package should be included.
If ommitted, the package is assumed to be included for all targets.
setup_hint: Option<String>A human-readable string with suggestions for setup if packaging fails.
Implementations
sourceimpl Package
impl Package
pub fn get_output_path(&self, name: &str, output_directory: &Path) -> PathBuf
sourcepub async fn create(&self, name: &str, output_directory: &Path) -> Result<File>
pub async fn create(&self, name: &str, output_directory: &Path) -> Result<File>
Constructs the package file in the output directory.
sourcepub fn get_total_work(&self) -> u64
pub fn get_total_work(&self) -> u64
Returns the “total number of things to be done” when constructing a package.
This is intentionally vaguely defined, but it intended to
be a rough indication of progress when using Self::create_with_progress.
sourcepub async fn create_with_progress(
&self,
progress: &impl Progress,
name: &str,
output_directory: &Path
) -> Result<File>
pub async fn create_with_progress(
&self,
progress: &impl Progress,
name: &str,
output_directory: &Path
) -> Result<File>
Identical to Self::create, but allows a caller to receive updates
about progress while constructing the package.