Trait CompressibleBy

Source
pub trait CompressibleBy<Ctx>: Compressible
where 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§

Source

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.

Implementations on Foreign Types§

Source§

impl<Ctx> CompressibleBy<Ctx> for u8
where Ctx: ContextError,

Source§

async fn compress_with(&self, _: &mut Ctx) -> Result<Self, Ctx::Error>

Source§

impl<Ctx> CompressibleBy<Ctx> for u16
where Ctx: ContextError,

Source§

async fn compress_with(&self, _: &mut Ctx) -> Result<Self, Ctx::Error>

Source§

impl<Ctx> CompressibleBy<Ctx> for u32
where Ctx: ContextError,

Source§

async fn compress_with(&self, _: &mut Ctx) -> Result<Self, Ctx::Error>

Source§

impl<Ctx> CompressibleBy<Ctx> for u64
where Ctx: ContextError,

Source§

async fn compress_with(&self, _: &mut Ctx) -> Result<Self, Ctx::Error>

Source§

impl<Ctx> CompressibleBy<Ctx> for u128
where Ctx: ContextError,

Source§

async fn compress_with(&self, _: &mut Ctx) -> Result<Self, Ctx::Error>

Source§

impl<Ctx> CompressibleBy<Ctx> for BlobId
where Ctx: ContextError,

Source§

async fn compress_with(&self, _: &mut Ctx) -> Result<Self, Ctx::Error>

Source§

impl<Ctx> CompressibleBy<Ctx> for Bytes32
where Ctx: ContextError,

Source§

async fn compress_with(&self, _: &mut Ctx) -> Result<Self, Ctx::Error>

Source§

impl<Ctx> CompressibleBy<Ctx> for Nonce
where Ctx: ContextError,

Source§

async fn compress_with(&self, _: &mut Ctx) -> Result<Self, Ctx::Error>

Source§

impl<Ctx> CompressibleBy<Ctx> for Salt
where Ctx: ContextError,

Source§

async fn compress_with(&self, _: &mut Ctx) -> Result<Self, Ctx::Error>

Source§

impl<Ctx> CompressibleBy<Ctx> for BlockHeight
where Ctx: ContextError,

Source§

async fn compress_with(&self, _: &mut Ctx) -> Result<Self, Ctx::Error>

Source§

impl<T, Ctx> CompressibleBy<Ctx> for Vec<T>
where T: CompressibleBy<Ctx>, Ctx: ContextError,

Source§

async fn compress_with( &self, ctx: &mut Ctx, ) -> Result<Self::Compressed, Ctx::Error>

Source§

impl<const S: usize, T, Ctx> CompressibleBy<Ctx> for [T; S]
where T: CompressibleBy<Ctx>, Ctx: ContextError,

Source§

async fn compress_with( &self, ctx: &mut Ctx, ) -> Result<Self::Compressed, Ctx::Error>

Implementors§