pub struct Package {
pub version: String,
pub git_commit_hash: Option<String>,
pub target: BTreeMap<String, Artefact>,
}Expand description
A single package installable from this release channel.
Building a package for a particular target produces an artefact, but every artefact should be built from the same source.
Fields§
§version: StringA human-readable version-number for this package.
This should be a SemVer version number of the form X.Y.Z,
followed by a space,
an open-parenthesis,
a Git commit ID truncated to 9 digits,
a space,
the date of that commit in YYYY-MM-DD format,
and a close-parenthesis:
1.2.3 (a1b2c3d4e 2018-02-26)git_commit_hash: Option<String>The complete Git commit ID of this version of this package.
May not be present if the commit ID is not known, or this package’s source is not stored in a Git repository.
target: BTreeMap<String, Artefact>A mapping from target names to Artefacts of this package built
for that target.
A target name
(sometimes “target triplet”,
although there’s not always three parts)
is a name that identifies a particular hardware and software platform,
such as x86_64-unknown-linux-gnu (for modern Linux PCs)
or i686-pc-windows-msvc
(for 32-bit Windows with the Visual C++ compiler).
Software built for a particular target
usually won’t work on a different target,
so if you’re looking for a particular package
you’ll want to get the artefact for the platform you’re using.
The special target name * (an asterisk)
is used for packages that are the same on every concievable platform,
like rust-src which contains the Rust source code.
Implementations§
Source§impl Package
impl Package
Sourcepub fn new(version: String) -> Package
pub fn new(version: String) -> Package
Create a new, empty Package whose version is set to the given value.
By convention, version is in the format X.Y.Z (HHHHHHH YYYY-MM-DD)
where X.Y.Z is a SemVer version string,
HHHHHHH is the abbreviated commit ID of the source repository
at that version,
and YYYY-MM-DD is the date when that version was released.
let pkg = rust_release_channel::Package::new(
"1.2.3 (abc1234 2018-02-26)".into()
);