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§
source§impl Package
impl Package
pub fn get_output_path(&self, name: &str, output_directory: &Path) -> PathBuf
pub fn get_output_file(&self, name: &str) -> String
sourcepub async fn create(&self, name: &str, output_directory: &Path) -> Result<File>
👎Deprecated: Call Self::create_for_target instead
pub async fn create(&self, name: &str, output_directory: &Path) -> Result<File>
Constructs the package file in the output directory.
pub async fn create_for_target( &self, target: &Target, name: &str, output_directory: &Path ) -> Result<File>
sourcepub fn get_total_work(&self) -> u64
👎Deprecated: Call Self::get_total_work_for_target instead
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 fn get_total_work_for_target(&self, target: &Target) -> Result<u64>
pub fn get_total_work_for_target(&self, target: &Target) -> Result<u64>
Returns the “total number of things to be done” when constructing a package for a particular target.
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>
👎Deprecated: Call Self::create_with_progress_for_target instead
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.
sourcepub async fn create_with_progress_for_target(
&self,
progress: &impl Progress,
target: &Target,
name: &str,
output_directory: &Path
) -> Result<File>
pub async fn create_with_progress_for_target( &self, progress: &impl Progress, target: &Target, name: &str, output_directory: &Path ) -> Result<File>
Identical to Self::create, but allows a caller to receive updates
about progress while constructing the package.