pub enum SkippableChecksum<D: Digest + Clone> {
Skip,
Checksum {
digest: Checksum<D>,
},
}
Expand description
A Checksum
that may be skipped.
Strings representing checksums are used to verify the integrity of files.
If the "SKIP"
keyword is found, the integrity check is skipped.
Variants§
Skip
Sourcefile checksum validation may be skipped, which is expressed with this variant.
Checksum
The related source file should be validated via the provided checksum.
Trait Implementations§
Source§impl<D: Clone + Digest + Clone> Clone for SkippableChecksum<D>
impl<D: Clone + Digest + Clone> Clone for SkippableChecksum<D>
Source§fn clone(&self) -> SkippableChecksum<D>
fn clone(&self) -> SkippableChecksum<D>
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl<D: Digest + Clone> FromStr for SkippableChecksum<D>
impl<D: Digest + Clone> FromStr for SkippableChecksum<D>
Source§fn from_str(s: &str) -> Result<SkippableChecksum<D>, Self::Err>
fn from_str(s: &str) -> Result<SkippableChecksum<D>, Self::Err>
Create a new SkippableChecksum
from a string slice and return it in a Result.
First checks for the special SKIP
keyword, before trying Checksum::from_str
.
§Examples
use std::str::FromStr;
use alpm_types::{SkippableChecksum, digests::Sha256};
assert!(SkippableChecksum::<Sha256>::from_str("SKIP").is_ok());
assert!(
SkippableChecksum::<Sha256>::from_str(
"b5bb9d8014a0f9b1d61e21e796d78dccdf1352f23cd32812f4850b878ae4944c"
)
.is_ok()
);
Auto Trait Implementations§
impl<D> Freeze for SkippableChecksum<D>
impl<D> RefUnwindSafe for SkippableChecksum<D>where
D: RefUnwindSafe,
impl<D> !Send for SkippableChecksum<D>
impl<D> !Sync for SkippableChecksum<D>
impl<D> Unpin for SkippableChecksum<D>
impl<D> UnwindSafe for SkippableChecksum<D>where
D: RefUnwindSafe,
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