use std::future::Future;
use std::pin::Pin;
use zeph_common::ToolName;
use super::{CompressionError, OutputCompressor};
#[derive(Debug, Default, Clone)]
pub struct IdentityCompressor;
impl OutputCompressor for IdentityCompressor {
fn compress<'a>(
&'a self,
_tool_name: &'a ToolName,
_output: &'a str,
) -> Pin<Box<dyn Future<Output = Result<Option<String>, CompressionError>> + Send + 'a>> {
Box::pin(std::future::ready(Ok(None)))
}
fn name(&self) -> &'static str {
"identity"
}
}
#[cfg(test)]
mod tests {
use super::*;
#[tokio::test]
async fn identity_always_passes_through() {
let c = IdentityCompressor;
let name = ToolName::new("shell");
let result = c.compress(&name, "hello world").await.unwrap();
assert!(result.is_none());
}
}