We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2c089d7 commit b59557fCopy full SHA for b59557f
decompression-plz/src/encoding_type.rs
@@ -0,0 +1,22 @@
1
+use header_plz::body_headers::{BodyHeader, encoding_info::EncodingInfo};
2
+
3
+pub enum EncodingType {
4
+ TransferEncoding,
5
+ ContentEncoding,
6
+}
7
8
+impl EncodingType {
9
+ pub fn encoding_info<'a>(
10
+ &self,
11
+ body_headers: Option<&'a mut BodyHeader>,
12
+ ) -> Option<&'a mut Vec<EncodingInfo>> {
13
+ match self {
14
+ EncodingType::TransferEncoding => {
15
+ body_headers.and_then(|bh| bh.transfer_encoding.as_mut())
16
+ }
17
+ EncodingType::ContentEncoding => {
18
+ body_headers.and_then(|bh| bh.content_encoding.as_mut())
19
20
21
22
0 commit comments