pub struct ArtefactQuery<'a> {
pub pkg: &'a str,
pub target: &'a str,
}Expand description
Names an Artefact that might exist in a channel.
This structure provides
a way to talk about and refer to artefacts
without having to find an already-existing ArtefactToken,
or construct a whole new one.
let query = rust_release_channel::ArtefactQuery::new(
"rust",
"x86_64-unknown-linux-gnu",
);
let artefact = channel.lookup_artefact(query);Fields§
§pkg: &'a strThe name of the package that was built to produce the target artefact.
See Channel::pkg for details.
target: &'a strThe name of the target the package was built for to produce the target artefact.
See Package::target for details.
Implementations§
Source§impl<'a> ArtefactQuery<'a>
impl<'a> ArtefactQuery<'a>
Sourcepub fn new(pkg: &'a str, target: &'a str) -> ArtefactQuery<'a>
pub fn new(pkg: &'a str, target: &'a str) -> ArtefactQuery<'a>
Create a new ArtefactQuery for the given package and target.
pkg is the name of the package that was built
to produce the target artefact.
target is the name of the target the package was built for
to produce the target artefact.
let query = rust_release_channel::ArtefactQuery::new(
"somepackage",
"aarch64-unknown-linux-gnu",
);Sourcepub fn to_token(&self) -> ArtefactToken
pub fn to_token(&self) -> ArtefactToken
Create an ArtefactToken with the same contents.
This allocates new copies of the pkg and target fields
so that the new ArtefactToken struct can own them.
This is effectively the same thing as:
let token = rust_release_channel::ArtefactToken::new(
query.pkg.into(),
query.target.into(),
);An example:
let token = rust_release_channel::ArtefactQuery::new(
"rls",
"x86_64-unknown-linux-gnu",
).to_token();
artefact.extensions.push(token);Trait Implementations§
Source§impl<'a> Clone for ArtefactQuery<'a>
impl<'a> Clone for ArtefactQuery<'a>
Source§fn clone(&self) -> ArtefactQuery<'a>
fn clone(&self) -> ArtefactQuery<'a>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more