hyperlane_plugin_compression/struct.rs
1use super::*;
2
3/// The configuration of the compression plugin.
4#[derive(Clone, Debug, Getter)]
5pub struct CompressionConfig {
6 /// The smallest body that is worth compressing.
7 #[get(type(copy))]
8 pub min_size: usize,
9 /// The encodings that are offered, in the order they are preferred.
10 pub encodings: Vec<Compress>,
11}
12
13/// The plugin that compresses the answers of a server.
14#[derive(Clone, Copy, Debug, Default)]
15pub struct CompressionPlugin;
16
17/// The middleware that marks the answer with the encoding the client asked
18/// for.
19#[derive(Clone, Copy, Debug, Default)]
20#[hyperlane::response_middleware(-110)]
21pub struct CompressionMiddleware;