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.
Trait Implementations§
Source§impl<D: DigestString + Clone> AlpmParser for SkippableChecksum<D>
impl<D: DigestString + Clone> AlpmParser for SkippableChecksum<D>
Source§fn parser(input: &mut &str) -> ModalResult<Self>
fn parser(input: &mut &str) -> ModalResult<Self>
Recognizes a SkippableChecksum in a string slice.
See SkippableChecksum::from_str, Checksum::parser and Checksum::from_str.
§Errors
Returns an error if input does not start with the output of a hash function
in hexadecimal (or decimal in case of CRC-32/CKSUM) form, or the keyword SKIP.
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 (const: unstable) · 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()
);Source§impl<D: DigestString + Clone> PartialEq for SkippableChecksum<D>
impl<D: DigestString + Clone> PartialEq for SkippableChecksum<D>
Source§impl<D> Serialize for SkippableChecksum<D>where
D: Digest + Clone + DigestString,
impl<D> Serialize for SkippableChecksum<D>where
D: Digest + Clone + DigestString,
Auto Trait Implementations§
impl<D> Freeze for SkippableChecksum<D>
impl<D> RefUnwindSafe for SkippableChecksum<D>where
D: RefUnwindSafe,
impl<D> Send for SkippableChecksum<D>where
D: Send,
impl<D> Sync for SkippableChecksum<D>where
D: Sync,
impl<D> Unpin for SkippableChecksum<D>where
D: Unpin,
impl<D> UnsafeUnpin for SkippableChecksum<D>
impl<D> UnwindSafe for SkippableChecksum<D>where
D: UnwindSafe,
Blanket Implementations§
§impl<T> AnyEq for T
impl<T> AnyEq for T
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<U> ParserUntil for Uwhere
U: AlpmParser,
impl<U> ParserUntil for Uwhere
U: AlpmParser,
Source§fn parser_until<'a, P>(
delimiter: P,
) -> impl Parser<&'a str, U, ErrMode<ContextError>>
fn parser_until<'a, P>( delimiter: P, ) -> impl Parser<&'a str, U, ErrMode<ContextError>>
Returns a [Parser] that parses Self until the given delimiter parser
matches.
§Note
Does not consume the delimiter.
Source§fn parser_until_eof(input: &mut &str) -> Result<Self, ErrMode<ContextError>>
fn parser_until_eof(input: &mut &str) -> Result<Self, ErrMode<ContextError>>
Source§impl<U> ParserUntilInclusive for Uwhere
U: ParserUntil,
impl<U> ParserUntilInclusive for Uwhere
U: ParserUntil,
Source§fn parser_until_inclusive<'a, P>(
delimiter: P,
) -> impl Parser<&'a str, U, ErrMode<ContextError>>
fn parser_until_inclusive<'a, P>( delimiter: P, ) -> impl Parser<&'a str, U, ErrMode<ContextError>>
Returns a [Parser] that parses the whole input and consumes the given delimiter parser.
Delegates to ParserUntil::parser_until and consumes the delimiter.