pub trait CertCompressor:
Debug
+ Send
+ Sync {
// Required methods
fn compress(
&self,
input: Vec<u8>,
level: CompressionLevel,
) -> Result<Vec<u8>, CompressionFailed>;
fn algorithm(&self) -> CertificateCompressionAlgorithm;
}
Expand description
An available certificate compression algorithm.
Required Methods§
Sourcefn compress(
&self,
input: Vec<u8>,
level: CompressionLevel,
) -> Result<Vec<u8>, CompressionFailed>
fn compress( &self, input: Vec<u8>, level: CompressionLevel, ) -> Result<Vec<u8>, CompressionFailed>
Compress input
, returning the result.
input
is consumed by this function so (if the underlying implementation
supports it) the compression can be performed in-place.
level
is a hint as to how much effort to expend on the compression.
Err(CompressionFailed)
may be returned for any reason.
Sourcefn algorithm(&self) -> CertificateCompressionAlgorithm
fn algorithm(&self) -> CertificateCompressionAlgorithm
Which algorithm this compressor handles.