diff options
author | Justus Winter <justus@sequoia-pgp.org> | 2019-09-03 12:24:29 +0200 |
---|---|---|
committer | Justus Winter <justus@sequoia-pgp.org> | 2019-09-03 12:36:04 +0200 |
commit | 7b9035fac61467482de683f890eb3c9971e955db (patch) | |
tree | 584024194ded707adaf620af6fc817ba39b93294 /openpgp/src/keyid.rs | |
parent | 7901c7ee84e7863c5227ded5f29a36beddbcecb8 (diff) |
openpgp: Assert that central types are Send and Sync.
- Add compile-time assertions that public types like Packet, TPK,
Message... can be send across thread boundaries, and can be
safely accessed from multiple threads.
- Fixes #334.
Diffstat (limited to 'openpgp/src/keyid.rs')
-rw-r--r-- | openpgp/src/keyid.rs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/openpgp/src/keyid.rs b/openpgp/src/keyid.rs index 2e77c962..275599f9 100644 --- a/openpgp/src/keyid.rs +++ b/openpgp/src/keyid.rs @@ -215,4 +215,10 @@ mod test { assert_match!(KeyID::Invalid(_) = KeyID::from_hex("0x587DAEF1").unwrap()); } + + #[test] + fn keyid_is_send_and_sync() { + fn f<T: Send + Sync>(_: T) {} + f(KeyID::from_hex("89AB CDEF 0123 4567").unwrap()); + } } |