pub enum SkippableChecksum<D: DigestString + 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.
Implementations§
Source§impl<D: DigestString + Clone> SkippableChecksum<D>
impl<D: DigestString + Clone> SkippableChecksum<D>
Sourcepub fn is_skipped(&self) -> bool
pub fn is_skipped(&self) -> bool
Determines whether the SkippableChecksum is skipped.
Checksums are considered skipped if they are of the variant SkippableChecksum::Skip.
Sourcepub fn parser(input: &mut &str) -> ModalResult<Self>
pub fn parser(input: &mut &str) -> ModalResult<Self>
Recognizes a SkippableChecksum from a string slice.
Consumes all its input.
See SkippableChecksum::from_str, Checksum::parser and Checksum::from_str.
§Errors
Returns an error if input is not the output of a hash function
in hexadecimal (or decimal in case of CRC32/CKSUM) form.
Trait Implementations§
Source§impl<D: Clone + DigestString + Clone> Clone for SkippableChecksum<D>
impl<D: Clone + DigestString + Clone> Clone for SkippableChecksum<D>
Source§fn clone(&self) -> SkippableChecksum<D>
fn clone(&self) -> SkippableChecksum<D>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl<D: Debug + DigestString + Clone> Debug for SkippableChecksum<D>
impl<D: Debug + DigestString + Clone> Debug for SkippableChecksum<D>
Source§impl<'de, D> Deserialize<'de> for SkippableChecksum<D>where
D: Digest + Clone + DigestString,
impl<'de, D> Deserialize<'de> for SkippableChecksum<D>where
D: Digest + Clone + DigestString,
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl<D: DigestString + Clone> Display for SkippableChecksum<D>
impl<D: DigestString + Clone> Display for SkippableChecksum<D>
Source§impl<D: DigestString + Clone> FromStr for SkippableChecksum<D>
impl<D: DigestString + 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.
Delegates to SkippableChecksum::parser.
§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()
);