pub enum PackageValidation {
None,
Md5,
Sha256,
Pgp,
}Expand description
The validation method used during installation of a package.
A validation method can ensure the integrity of a package.
Certain methods (i.e. PackageValidation::Pgp) can also be used to ensure a package’s
authenticity.
§Examples
Parsing from strings:
use std::str::FromStr;
use alpm_types::PackageValidation;
assert_eq!(
PackageValidation::from_str("none")?,
PackageValidation::None
);
assert_eq!(PackageValidation::from_str("md5")?, PackageValidation::Md5);
assert_eq!(
PackageValidation::from_str("sha256")?,
PackageValidation::Sha256
);
assert_eq!(PackageValidation::from_str("pgp")?, PackageValidation::Pgp);
// Invalid values return an error.
assert!(PackageValidation::from_str("crc32").is_err());Displaying and serializing:
use alpm_types::PackageValidation;
assert_eq!(PackageValidation::Md5.to_string(), "md5");
assert_eq!(
serde_json::to_string(&PackageValidation::Sha256).expect("Serialization failed"),
"\"Sha256\""
);Variants§
None
The package integrity and authenticity is not validated.
Md5
The package is validated against an accompanying MD5 hash digest.
Sha256
The package is validated against an accompanying SHA-256 hash digest.
Pgp
The package is validated using PGP signatures.
Trait Implementations§
Source§impl AlpmParser for PackageValidation
impl AlpmParser for PackageValidation
Source§fn parser(input: &mut &str) -> Result<Self, ErrMode<ContextError>>
fn parser(input: &mut &str) -> Result<Self, ErrMode<ContextError>>
Recognizes a PackageValidation in a string slice.
§Errors
Returns an error if input does not begin with a valid variant
of PackageValidation.
Source§impl AsRef<str> for PackageValidation
impl AsRef<str> for PackageValidation
Source§impl Clone for PackageValidation
impl Clone for PackageValidation
Source§fn clone(&self) -> PackageValidation
fn clone(&self) -> PackageValidation
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for PackageValidation
impl Debug for PackageValidation
Source§impl<'de> Deserialize<'de> for PackageValidation
impl<'de> Deserialize<'de> for PackageValidation
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 Display for PackageValidation
impl Display for PackageValidation
Source§impl FromStr for PackageValidation
impl FromStr for PackageValidation
Source§impl PartialEq for PackageValidation
impl PartialEq for PackageValidation
Source§fn eq(&self, other: &PackageValidation) -> bool
fn eq(&self, other: &PackageValidation) -> bool
self and other values to be equal, and is used by ==.Source§impl Serialize for PackageValidation
impl Serialize for PackageValidation
Source§impl TryFrom<&str> for PackageValidation
impl TryFrom<&str> for PackageValidation
Source§impl VariantNames for PackageValidation
impl VariantNames for PackageValidation
impl StructuralPartialEq for PackageValidation
Auto Trait Implementations§
impl Freeze for PackageValidation
impl RefUnwindSafe for PackageValidation
impl Send for PackageValidation
impl Sync for PackageValidation
impl Unpin for PackageValidation
impl UnsafeUnpin for PackageValidation
impl UnwindSafe for PackageValidation
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,
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.