summaryrefslogtreecommitdiffstats
path: root/openpgp/src/serialize/stream.rs
diff options
context:
space:
mode:
Diffstat (limited to 'openpgp/src/serialize/stream.rs')
-rw-r--r--openpgp/src/serialize/stream.rs15
1 files changed, 7 insertions, 8 deletions
diff --git a/openpgp/src/serialize/stream.rs b/openpgp/src/serialize/stream.rs
index f77dfee0..0948a242 100644
--- a/openpgp/src/serialize/stream.rs
+++ b/openpgp/src/serialize/stream.rs
@@ -205,6 +205,7 @@ impl Default for Cookie {
/// [`Message::finalize`]: #method.finalize
#[derive(Debug)]
pub struct Message<'a>(writer::BoxStack<'a, Cookie>);
+assert_send_and_sync!{Message<'_>}
impl<'a> Message<'a> {
/// Starts streaming an OpenPGP message.
@@ -344,6 +345,7 @@ pub struct Armorer<'a> {
headers: Vec<(String, String)>,
inner: Message<'a>,
}
+assert_send_and_sync!{Armorer<'_>}
impl<'a> Armorer<'a> {
/// Creates a new armoring filter.
@@ -533,6 +535,7 @@ impl<'a> fmt::Debug for Armorer<'a> {
pub struct ArbitraryWriter<'a> {
inner: writer::BoxStack<'a, Cookie>,
}
+assert_send_and_sync!{ArbitraryWriter<'_>}
impl<'a> ArbitraryWriter<'a> {
/// Creates a new writer with the given tag.
@@ -643,6 +646,7 @@ pub struct Signer<'a> {
cookie: Cookie,
position: u64,
}
+assert_send_and_sync!{Signer<'_>}
impl<'a> Signer<'a> {
/// Creates a signer.
@@ -1276,6 +1280,7 @@ pub struct LiteralWriter<'a> {
inner: writer::BoxStack<'a, Cookie>,
signature_writer: Option<writer::BoxStack<'a, Cookie>>,
}
+assert_send_and_sync!{LiteralWriter<'_>}
impl<'a> LiteralWriter<'a> {
/// Creates a new literal writer.
@@ -1548,6 +1553,7 @@ pub struct Compressor<'a> {
level: CompressionLevel,
inner: writer::BoxStack<'a, Cookie>,
}
+assert_send_and_sync!{Compressor<'_>}
impl<'a> Compressor<'a> {
/// Creates a new compressor using the default algorithm and
@@ -2081,6 +2087,7 @@ pub struct Encryptor<'a> {
hash: Box<dyn crypto::hash::Digest>,
cookie: Cookie,
}
+assert_send_and_sync!{Encryptor<'_>}
impl<'a> Encryptor<'a> {
/// Creates a new encryptor for the given recipients.
@@ -3298,12 +3305,4 @@ mod test {
Ok(())
}
-
- #[test]
- fn message_is_send_and_sync() {
- fn f<T: Send + Sync>(_: T) {}
- let mut sink = vec![];
- let message = Message::new(&mut sink);
- f(message);
- }
}