photon_protocol/compressor/
noop.rs1use bytes::BytesMut;
2
3use crate::ports::compress::{CompressionError, Compressor};
4
5#[derive(Clone)]
6pub struct NoopCompressor;
7
8impl Compressor for NoopCompressor {
9 fn compress(&self, input: &[u8], output: &mut BytesMut) -> Result<(), CompressionError> {
10 output.extend_from_slice(input);
11 Ok(())
12 }
13
14 fn decompress(&self, input: &[u8], output: &mut BytesMut) -> Result<(), CompressionError> {
15 output.extend_from_slice(input);
16 Ok(())
17 }
18
19 fn name(&self) -> &'static str {
20 "none"
21 }
22}