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.
Implementations§
Source§impl<D: Digest + Clone> SkippableChecksum<D>
impl<D: Digest + Clone> SkippableChecksum<D>
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 form.
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<'de, D> Deserialize<'de> for SkippableChecksum<D>
impl<'de, D> Deserialize<'de> for SkippableChecksum<D>
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>,
Deserialize this value from the given Serde deserializer. Read more
Source§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
.
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()
);
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> UnwindSafe for SkippableChecksum<D>where
D: UnwindSafe,
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