summaryrefslogtreecommitdiff
path: root/src/rpc/envoy.extensions.compression.qatzstd.compressor.v3alpha.rs
blob: 002e14f66d5a98cec6ac572eaf8852971c90e9a4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
// @generated
// This file is @generated by prost-build.
// \[#protodoc-title: Qatzstd Compressor\]
// Qatzstd :ref:`configuration overview <config_qatzstd>`.
// \[#extension: envoy.compression.qatzstd.compressor\]

/// \[#next-free-field: 8\]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct Qatzstd {
    /// Set compression parameters according to pre-defined compression level table.
    /// Note that exact compression parameters are dynamically determined,
    /// depending on both compression level and source content size (when known).
    /// Value 0 means default, and default level is 3.
    ///
    /// Setting a level does not automatically set all other compression parameters
    /// to default. Setting this will however eventually dynamically impact the compression
    /// parameters which have not been manually set. The manually set
    /// ones will 'stick'.
    #[prost(message, optional, tag="1")]
    pub compression_level: ::core::option::Option<super::super::super::super::super::super::google::protobuf::UInt32Value>,
    /// A 32-bits checksum of content is written at end of frame. If not set, defaults to false.
    #[prost(bool, tag="2")]
    pub enable_checksum: bool,
    /// The higher the value of selected strategy, the more complex it is,
    /// resulting in stronger and slower compression.
    ///
    /// Special: value 0 means "use default strategy".
    #[prost(enumeration="qatzstd::Strategy", tag="3")]
    pub strategy: i32,
    /// Value for compressor's next output buffer. If not set, defaults to 4096.
    #[prost(message, optional, tag="5")]
    pub chunk_size: ::core::option::Option<super::super::super::super::super::super::google::protobuf::UInt32Value>,
    /// Enable QAT to accelerate Zstd compression or not. If not set, defaults to false.
    ///
    /// This is useful in the case that users want to enable QAT for a period of time and disable QAT for another period of time,
    /// they don't have to change the config too much or prepare for another config that has software zstd compressor and just changing the value of this filed.
    #[prost(bool, tag="6")]
    pub enable_qat_zstd: bool,
    /// Fallback to software for Qatzstd when input size is less than this value.
    /// Valid only ``enable_qat_zstd`` is ``true``. 0 means no fallback at all. If not set, defaults to 4000.
    #[prost(message, optional, tag="7")]
    pub qat_zstd_fallback_threshold: ::core::option::Option<super::super::super::super::super::super::google::protobuf::UInt32Value>,
}
/// Nested message and enum types in `Qatzstd`.
pub mod qatzstd {
    /// Reference to <http://facebook.github.io/zstd/zstd_manual.html>
    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
    #[repr(i32)]
    pub enum Strategy {
        Default = 0,
        Fast = 1,
        Dfast = 2,
        Greedy = 3,
        Lazy = 4,
        Lazy2 = 5,
        Btlazy2 = 6,
        Btopt = 7,
        Btultra = 8,
        Btultra2 = 9,
    }
    impl Strategy {
        /// String value of the enum field names used in the ProtoBuf definition.
        ///
        /// The values are not transformed in any way and thus are considered stable
        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
        pub fn as_str_name(&self) -> &'static str {
            match self {
                Strategy::Default => "DEFAULT",
                Strategy::Fast => "FAST",
                Strategy::Dfast => "DFAST",
                Strategy::Greedy => "GREEDY",
                Strategy::Lazy => "LAZY",
                Strategy::Lazy2 => "LAZY2",
                Strategy::Btlazy2 => "BTLAZY2",
                Strategy::Btopt => "BTOPT",
                Strategy::Btultra => "BTULTRA",
                Strategy::Btultra2 => "BTULTRA2",
            }
        }
        /// Creates an enum from field names used in the ProtoBuf definition.
        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
            match value {
                "DEFAULT" => Some(Self::Default),
                "FAST" => Some(Self::Fast),
                "DFAST" => Some(Self::Dfast),
                "GREEDY" => Some(Self::Greedy),
                "LAZY" => Some(Self::Lazy),
                "LAZY2" => Some(Self::Lazy2),
                "BTLAZY2" => Some(Self::Btlazy2),
                "BTOPT" => Some(Self::Btopt),
                "BTULTRA" => Some(Self::Btultra),
                "BTULTRA2" => Some(Self::Btultra2),
                _ => None,
            }
        }
    }
}
// @@protoc_insertion_point(module)