#[non_exhaustive]pub struct ReleaseAsset { /* private fields */ }Expand description
Release asset information.
The fields are encapsulated (pub(crate), backed by Arc<str> to keep clones cheap) and read
through the name / download_url /
digest getters, which return borrows. Build one with
ReleaseAsset::new (plus with_digest when the forge publishes
a content digest for the asset).
Implementations§
Source§impl ReleaseAsset
impl ReleaseAsset
Sourcepub fn new(name: impl Into<String>, download_url: impl Into<String>) -> Self
pub fn new(name: impl Into<String>, download_url: impl Into<String>) -> Self
Construct a ReleaseAsset from its name and download URL.
Useful when implementing a custom ReleaseSource (the built-in backends build assets from
their own API responses) or when building a ReleaseAsset in your own tests — the type is
#[non_exhaustive], so it can’t be built with a struct literal from outside the crate.
Sourcepub fn with_digest(self, digest: impl Into<String>) -> Self
pub fn with_digest(self, digest: impl Into<String>) -> Self
Attach the asset’s content digest, in algorithm:hex form (e.g. sha256:2cf24d…).
The github backend fills this from the API’s per-asset digest field; a custom
ReleaseSource can chain this onto new when its forge publishes
one. With the checksums feature the updater verifies the downloaded artifact against this
digest before installing (see verify_release_digest on the builders).
Sourcepub fn download_url(&self) -> &str
pub fn download_url(&self) -> &str
The asset’s download URL.
Sourcepub fn digest(&self) -> Option<&str>
pub fn digest(&self) -> Option<&str>
The asset’s content digest in algorithm:hex form (e.g. sha256:2cf24d…), when the
backend provides one.
The github backend fills this from the release API’s per-asset digest field; gitlab,
gitea, and s3 do not expose one, so it is None there. Note the digest is an integrity
check only — the forge recomputes it if an asset is replaced — so it is not a substitute
for signature verification (the signatures feature).
Trait Implementations§
Source§impl Clone for ReleaseAsset
impl Clone for ReleaseAsset
Source§fn clone(&self) -> ReleaseAsset
fn clone(&self) -> ReleaseAsset
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more