feat!: remove codegen dependency on compression feature (#1004)

This commit is contained in:
Marcus Griep
2022-06-13 17:48:27 -04:00
committed by GitHub
parent d9f5c75112
commit a585a72293
21 changed files with 264 additions and 388 deletions
+6 -6
View File
@@ -79,20 +79,20 @@ pub fn generate<T: Service>(
#service_ident::new(InterceptedService::new(inner, interceptor))
}
/// Compress requests with `gzip`.
/// Compress requests with the given encoding.
///
/// This requires the server to support it otherwise it might respond with an
/// error.
#[must_use]
pub fn send_gzip(mut self) -> Self {
self.inner = self.inner.send_gzip();
pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.send_compressed(encoding);
self
}
/// Enable decompressing responses with `gzip`.
/// Enable decompressing responses.
#[must_use]
pub fn accept_gzip(mut self) -> Self {
self.inner = self.inner.accept_gzip();
pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.accept_compressed(encoding);
self
}