跳到主要内容

CertCompressor

特性 CertCompressor 

Source
pub trait CertCompressor:
    Debug
    + Send
    + Sync {
    // Required methods
    fn compress(
        &self,
        input: Vec<u8>,
        level: CompressionLevel,
    ) -> Result<Vec<u8>, CompressionFailed>;
    fn algorithm(&self) -> CertificateCompressionAlgorithm;
}
展开描述

可用的证书压缩算法

必需方法§

Source

fn compress( &self, input: Vec<u8>, level: CompressionLevel, ) -> Result<Vec<u8>, CompressionFailed>

Compress input, returning 结果.

input is 已消耗 by 此函数 so (if 底层 implementation supports it) the compression can be performed in-place.

level 是 hint as 到 how much effort 到 expend on the compression.

Err(CompressionFailed) may be returned 用于 any reason.

Source

fn algorithm(&self) -> CertificateCompressionAlgorithm

此压缩器处理的算法

实现者§