summaryrefslogtreecommitdiffstats
path: root/openpgp/src/lib.rs
diff options
context:
space:
mode:
authorJustus Winter <justus@sequoia-pgp.org>2019-12-19 19:53:00 +0100
committerJustus Winter <justus@sequoia-pgp.org>2019-12-20 18:04:56 +0100
commit3a80d2a1866b57b8c07f62ce095d951458e18430 (patch)
treec049b88d5715b1f451ee613326937f3c9b2d2370 /openpgp/src/lib.rs
parentffe6305f8be2bfb4106db177985c709493c7383d (diff)
openpgp: Keep track whether a container has been streamed.
- If a container was streamed, we can no longer compare it to other packets. Keep track of that, and use it in Container::PartialEq. - See #93.
Diffstat (limited to 'openpgp/src/lib.rs')
-rw-r--r--openpgp/src/lib.rs13
1 files changed, 12 insertions, 1 deletions
diff --git a/openpgp/src/lib.rs b/openpgp/src/lib.rs
index f503f77f..3bca389f 100644
--- a/openpgp/src/lib.rs
+++ b/openpgp/src/lib.rs
@@ -285,8 +285,19 @@ pub enum Error {
/// than a `CompressedData` packet.
///
/// [Section 5 of RFC 4880]: https://tools.ietf.org/html/rfc4880#section-5
+///
+/// # A note on partial equality
+///
+/// Container packets, like the [`CompressedData`] and the [`SEIP`]
+/// packet, can be streamed. If a packet is streamed, we no longer
+/// have access to the content, and therefore cannot compare it to
+/// other packets. Consequently, a streamed packet is not considered
+/// equal to any other packet.
+///
+/// [`CompressedData`]: packet/struct.CompressedData.html
+/// [`SEIP`]: packet/enum.SEIP.html
#[derive(Debug)]
-#[derive(PartialEq, Eq, Hash, Clone)]
+#[derive(PartialEq, Hash, Clone)]
pub enum Packet {
/// Unknown packet.
Unknown(packet::Unknown),