Enum sequoia_openpgp::types::CompressionAlgorithm [−][src]
#[non_exhaustive]
pub enum CompressionAlgorithm {
Uncompressed,
Zip,
Zlib,
BZip2,
Private(u8),
Unknown(u8),
}
Expand description
The OpenPGP compression algorithms as defined in Section 9.3 of RFC 4880.
Note: This enum cannot be exhaustively matched to allow future extensions.
Examples
Use CompressionAlgorithm
to set the preferred compressions algorithms on
a signature:
use sequoia_openpgp as openpgp;
use openpgp::packet::signature::SignatureBuilder;
use openpgp::types::{HashAlgorithm, CompressionAlgorithm, SignatureType};
let mut builder = SignatureBuilder::new(SignatureType::DirectKey)
.set_hash_algo(HashAlgorithm::SHA512)
.set_preferred_compression_algorithms(vec![
CompressionAlgorithm::Zlib,
CompressionAlgorithm::BZip2,
])?;
Variants (Non-exhaustive)
This enum is marked as non-exhaustive
Null compression.
DEFLATE Compressed Data.
See RFC 1951 for details. Section 9.3 of RFC 4880 recommends that this algorithm should be implemented.
ZLIB Compressed Data.
See RFC 1950 for details.
bzip2
Private(u8)
Private compression algorithm identifier.
Tuple Fields of Private
0: u8
Unknown(u8)
Unknown compression algorithm identifier.
Tuple Fields of Unknown
0: u8
Implementations
Returns whether this algorithm is supported.
Examples
use sequoia_openpgp as openpgp;
use openpgp::types::CompressionAlgorithm;
assert!(CompressionAlgorithm::Uncompressed.is_supported());
assert!(CompressionAlgorithm::Zip.is_supported());
assert!(!CompressionAlgorithm::Private(101).is_supported());
Trait Implementations
Performs the conversion.
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
This method tests for !=
.
This method returns an ordering between self
and other
values if one exists. Read more
This method tests less than (for self
and other
) and is used by the <
operator. Read more
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
Auto Trait Implementations
impl RefUnwindSafe for CompressionAlgorithm
impl Send for CompressionAlgorithm
impl Sync for CompressionAlgorithm
impl Unpin for CompressionAlgorithm
impl UnwindSafe for CompressionAlgorithm
Blanket Implementations
Mutably borrows from an owned value. Read more