From 149d77f437f2ac2f2dafa4c424a39263b5ffebdc Mon Sep 17 00:00:00 2001 From: Justus Winter Date: Thu, 13 Aug 2020 09:47:36 +0200 Subject: openpgp: Add note to enums that cannot be exhaustively matched. --- openpgp/src/types/mod.rs | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'openpgp/src/types/mod.rs') diff --git a/openpgp/src/types/mod.rs b/openpgp/src/types/mod.rs index dff23cc3..8bc4009e 100644 --- a/openpgp/src/types/mod.rs +++ b/openpgp/src/types/mod.rs @@ -74,6 +74,9 @@ pub(crate) use timestamp::normalize_systemtime; /// The OpenPGP public key algorithms as defined in [Section 9.1 of /// RFC 4880], and [Section 5 of RFC 6637]. /// +/// Note: This enum cannot be exhaustively matched to allow future +/// extensions. +/// /// # Examples /// /// ```rust @@ -296,6 +299,9 @@ impl PublicKeyAlgorithm { /// curves. Instead, the curve is specified using an OID prepended to /// the key material. We provide this type to be able to match on the /// curves. +/// +/// Note: This enum cannot be exhaustively matched to allow future +/// extensions. #[derive(Debug, Clone, Hash, PartialEq, Eq, PartialOrd, Ord)] pub enum Curve { /// NIST curve P-256. @@ -530,6 +536,9 @@ impl Arbitrary for Curve { /// /// [`SymmetricAlgorithm::from`]: https://doc.rust-lang.org/std/convert/trait.From.html /// +/// Note: This enum cannot be exhaustively matched to allow future +/// extensions. +/// /// # Examples /// /// Use `SymmetricAlgorithm` to set the preferred symmetric algorithms on a signature: @@ -686,6 +695,9 @@ impl Arbitrary for SymmetricAlgorithm { /// /// [`AEADAlgorithm::from`]: https://doc.rust-lang.org/std/convert/trait.From.html /// +/// Note: This enum cannot be exhaustively matched to allow future +/// extensions. +/// /// This feature is [experimental](../index.html#experimental-features). /// /// # Examples @@ -796,6 +808,9 @@ impl Arbitrary for AEADAlgorithm { /// /// [Section 9.3 of RFC 4880]: https://tools.ietf.org/html/rfc4880#section-9.3 /// +/// Note: This enum cannot be exhaustively matched to allow future +/// extensions. +/// /// # Examples /// /// Use `CompressionAlgorithm` to set the preferred compressions algorithms on @@ -938,6 +953,9 @@ impl Arbitrary for CompressionAlgorithm { /// The OpenPGP hash algorithms as defined in [Section 9.4 of RFC 4880]. /// +/// Note: This enum cannot be exhaustively matched to allow future +/// extensions. +/// /// # Examples /// /// Use `HashAlgorithm` to set the preferred hash algorithms on a signature: @@ -1075,6 +1093,9 @@ impl Arbitrary for HashAlgorithm { /// /// [Section 5.2.1 of RFC 4880]: https://tools.ietf.org/html/rfc4880#section-5.2.1 /// +/// Note: This enum cannot be exhaustively matched to allow future +/// extensions. +/// /// # Examples /// /// Use `SignatureType` to create a timestamp signature: @@ -1235,6 +1256,9 @@ impl Arbitrary for SignatureType { /// /// [Section 5.2.3.23 of RFC 4880]: https://tools.ietf.org/html/rfc4880#section-5.2.3.23 /// +/// Note: This enum cannot be exhaustively matched to allow future +/// extensions. +/// /// # Examples /// /// ```rust @@ -1496,6 +1520,9 @@ impl ReasonForRevocation { /// /// [Section 5.9 of RFC 4880]: https://tools.ietf.org/html/rfc4880#section-5.9 /// +/// Note: This enum cannot be exhaustively matched to allow future +/// extensions. +/// /// # Examples /// /// Construct a new [`Message`] containing one text literal packet: -- cgit v1.2.3