From 945c2cbaf9c71ab02ebe04c943a27edfd2276a75 Mon Sep 17 00:00:00 2001 From: Justus Winter Date: Tue, 31 Mar 2020 11:11:18 +0200 Subject: openpgp: Move definition of struct Message. --- openpgp/src/message/mod.rs | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) (limited to 'openpgp/src/message/mod.rs') 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") -- cgit v1.2.3