pub struct PackageDigest {
pub algorithm: DigestAlgorithm,
pub value: String,
}Expand description
The digest a downloaded package must match.
Fields§
§algorithm: DigestAlgorithm§value: StringLower-case hexadecimal.
Implementations§
Source§impl PackageDigest
impl PackageDigest
Sourcepub fn sha256(value: impl AsRef<str>) -> Self
pub fn sha256(value: impl AsRef<str>) -> Self
A SHA-256 digest, from hexadecimal in either case.
Sourcepub fn is_well_formed(&self) -> bool
pub fn is_well_formed(&self) -> bool
Whether this digest could be one: the right length, and hexadecimal.
A malformed digest is refused before a download starts rather than after it, so nobody waits for two hundred megabytes to learn the release feed was misconfigured.
Sourcepub fn to_feed_string(&self) -> String
pub fn to_feed_string(&self) -> String
The sha256:<hex> form.
Trait Implementations§
Source§impl Clone for PackageDigest
impl Clone for PackageDigest
Source§impl Debug for PackageDigest
impl Debug for PackageDigest
impl Eq for PackageDigest
Source§impl Hash for PackageDigest
impl Hash for PackageDigest
Source§impl PartialEq for PackageDigest
impl PartialEq for PackageDigest
impl StructuralPartialEq for PackageDigest
Auto Trait Implementations§
impl Freeze for PackageDigest
impl RefUnwindSafe for PackageDigest
impl Send for PackageDigest
impl Sync for PackageDigest
impl Unpin for PackageDigest
impl UnsafeUnpin for PackageDigest
impl UnwindSafe for PackageDigest
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more