Trait aws_smithy_compression::Compress

source ·
pub trait Compress: Send + Sync {
    // Required method
    fn compress_bytes(
        &mut self,
        bytes: &[u8],
        writer: &mut dyn Write,
    ) -> Result<(), BoxError>;
}
Expand description

Types implementing this trait can compress data.

Compression algorithms are used reduce the size of data. This trait requires Send + Sync because trait implementors are often used in an async context.

Required Methods§

source

fn compress_bytes( &mut self, bytes: &[u8], writer: &mut dyn Write, ) -> Result<(), BoxError>

Given a slice of bytes, and a Write implementor, compress and write bytes to the writer until done.

Implementors§