pgp/types/compression.rs
1use num_enum::{FromPrimitive, IntoPrimitive};
2
3/// Available compression algorithms.
4///
5/// Ref: <https://www.rfc-editor.org/rfc/rfc9580.html#name-compression-algorithms>
6#[derive(Debug, PartialEq, Eq, Clone, Copy, FromPrimitive, IntoPrimitive)]
7#[repr(u8)]
8#[cfg_attr(test, derive(proptest_derive::Arbitrary))]
9#[non_exhaustive]
10pub enum CompressionAlgorithm {
11 Uncompressed = 0,
12 ZIP = 1,
13 ZLIB = 2,
14 BZip2 = 3,
15 /// Do not use, just for compatibility with GnuPG.
16 #[cfg_attr(test, proptest(skip))] // not supported
17 Private10 = 110,
18
19 #[num_enum(catch_all)]
20 #[cfg_attr(test, proptest(skip))] // not supported
21 Other(u8),
22}