summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJustus Winter <justus@sequoia-pgp.org>2020-03-31 11:11:18 +0200
committerJustus Winter <justus@sequoia-pgp.org>2020-03-31 11:53:06 +0200
commit945c2cbaf9c71ab02ebe04c943a27edfd2276a75 (patch)
tree489c38fbca21668a78e9b1d26b289e109bf72594
parent5e5e16bf2fbc64c8347abe93fa33dc573b254a76 (diff)
openpgp: Move definition of struct Message.
-rw-r--r--openpgp/src/lib.rs15
-rw-r--r--openpgp/src/message/mod.rs21
2 files changed, 21 insertions, 15 deletions
diff --git a/openpgp/src/lib.rs b/openpgp/src/lib.rs
index 44e749d3..40aca343 100644
--- a/openpgp/src/lib.rs
+++ b/openpgp/src/lib.rs
@@ -154,6 +154,7 @@ pub mod serialize;
mod packet_pile;
pub use packet_pile::PacketPile;
pub mod message;
+pub use message::Message;
pub mod types;
use crate::types::{
@@ -433,17 +434,3 @@ impl Packet {
}
}
}
-
-/// An OpenPGP message.
-///
-/// An OpenPGP message is a structured sequence of OpenPGP packets.
-/// Basically, it's an optionally encrypted, optionally signed literal
-/// data packet. The exact structure is defined in [Section 11.3 of RFC
-/// 4880].
-///
-/// [Section 11.3 of RFC 4880]: https://tools.ietf.org/html/rfc4880#section-11.3
-#[derive(PartialEq)]
-pub struct Message {
- /// A message is just a validated packet pile.
- pile: PacketPile,
-}
diff --git a/openpgp/src/message/mod.rs b/openpgp/src/message/mod.rs
index 3a0c0624..5bb3f2e3 100644
--- a/openpgp/src/message/mod.rs
+++ b/openpgp/src/message/mod.rs
@@ -18,7 +18,6 @@ use crate::Result;
use crate::Error;
use crate::Packet;
use crate::PacketPile;
-use crate::Message;
use crate::packet::Literal;
use crate::packet::Tag;
use crate::parse::Parse;
@@ -307,6 +306,26 @@ impl MessageValidator {
}
}
+// DOC-HACK: To avoid having a top-level re-export of `Cert`, we move
+// it in a submodule `def`.
+pub use def::Message;
+mod def {
+use super::*;
+/// An OpenPGP message.
+///
+/// An OpenPGP message is a structured sequence of OpenPGP packets.
+/// Basically, it's an optionally encrypted, optionally signed literal
+/// data packet. The exact structure is defined in [Section 11.3 of RFC
+/// 4880].
+///
+/// [Section 11.3 of RFC 4880]: https://tools.ietf.org/html/rfc4880#section-11.3
+#[derive(PartialEq)]
+pub struct Message {
+ /// A message is just a validated packet pile.
+ pub(super) pile: PacketPile,
+}
+} // doc-hack, see above
+
impl fmt::Debug for Message {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
f.debug_struct("Message")