pub trait CompressibleBy<Ctx>: Compressiblewhere
Ctx: ContextError,{
// Required method
async fn compress_with(
&self,
ctx: &mut Ctx,
) -> Result<Self::Compressed, Ctx::Error>;
}Expand description
This type can be compressed to a more compact form and back using
CompressionContext.
Required Methods§
Sourceasync fn compress_with(
&self,
ctx: &mut Ctx,
) -> Result<Self::Compressed, Ctx::Error>
async fn compress_with( &self, ctx: &mut Ctx, ) -> Result<Self::Compressed, Ctx::Error>
Perform compression, returning the compressed data and possibly modifying the context. The context is mutable to allow for stateful compression. For instance, it can be used to extract original data when replacing it with references.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.