Skip to main content

mz_repr/mnt/build/debug/build/mz-repr-184343c51f2df8fe/out/
mz_repr.row.rs

1// This file is @generated by prost-build.
2#[derive(Clone, PartialEq, ::prost::Message)]
3pub struct ProtoRow {
4    #[prost(message, repeated, tag = "1")]
5    pub datums: ::prost::alloc::vec::Vec<ProtoDatum>,
6}
7#[derive(Clone, PartialEq, ::prost::Message)]
8pub struct ProtoDatum {
9    /// NB: Proto oneof ids `1..=15` get encoded in 1 byte and so we should
10    /// reserve them for the datum types we expect to be most popular.
11    ///
12    /// Null, False, and True are all likely to be frequent, but the encoded
13    /// length is exactly the same if they're here or in ProtoDatumOther. In
14    /// general, anything that can be encoded purely as a proto enum variant
15    /// (i.e. doesn't have a payload) is better off that way. If we run out of
16    /// 1-byte encodings of ProtoDatumOther, we can always add ProtoDatumOther2.
17    #[prost(
18        oneof = "proto_datum::DatumType",
19        tags = "1, 2, 3, 4, 5, 6, 7, 8, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33"
20    )]
21    pub datum_type: ::core::option::Option<proto_datum::DatumType>,
22}
23/// Nested message and enum types in `ProtoDatum`.
24pub mod proto_datum {
25    /// NB: Proto oneof ids `1..=15` get encoded in 1 byte and so we should
26    /// reserve them for the datum types we expect to be most popular.
27    ///
28    /// Null, False, and True are all likely to be frequent, but the encoded
29    /// length is exactly the same if they're here or in ProtoDatumOther. In
30    /// general, anything that can be encoded purely as a proto enum variant
31    /// (i.e. doesn't have a payload) is better off that way. If we run out of
32    /// 1-byte encodings of ProtoDatumOther, we can always add ProtoDatumOther2.
33    #[derive(Clone, PartialEq, ::prost::Oneof)]
34    pub enum DatumType {
35        #[prost(enumeration = "super::ProtoDatumOther", tag = "1")]
36        Other(i32),
37        #[prost(int32, tag = "2")]
38        Int16(i32),
39        #[prost(int32, tag = "3")]
40        Int32(i32),
41        #[prost(int64, tag = "4")]
42        Int64(i64),
43        #[prost(float, tag = "5")]
44        Float32(f32),
45        #[prost(double, tag = "6")]
46        Float64(f64),
47        #[prost(bytes, tag = "7")]
48        Bytes(::prost::bytes::Bytes),
49        /// Don't use 9-15 without truly understanding the NB above.
50        #[prost(string, tag = "8")]
51        String(::prost::alloc::string::String),
52        /// These get encoded with 2 bytes for the oneof id. It's a pretty easy
53        /// and low-debt migration to "bless" one of these into having a 1-byte
54        /// id (fill in the new field on write, but check if either field is set
55        /// on read). However, once a 1-byte id is used, it's gone forever, so
56        /// we're conservative in handing them out.
57        ///
58        /// Of these, I'd guess Timestamp and UUID are probably the first ones
59        /// we'd bless followed by Date and Time.
60        #[prost(message, tag = "16")]
61        Date(super::super::adt::date::ProtoDate),
62        #[prost(message, tag = "17")]
63        Time(::mz_proto::chrono::ProtoNaiveTime),
64        #[prost(message, tag = "18")]
65        Timestamp(::mz_proto::chrono::ProtoNaiveDateTime),
66        #[prost(message, tag = "19")]
67        TimestampTz(::mz_proto::chrono::ProtoNaiveDateTime),
68        #[prost(message, tag = "20")]
69        Interval(super::super::adt::interval::ProtoInterval),
70        #[prost(message, tag = "21")]
71        Array(super::ProtoArray),
72        #[prost(message, tag = "22")]
73        List(super::ProtoRow),
74        #[prost(message, tag = "23")]
75        Dict(super::ProtoDict),
76        #[prost(message, tag = "24")]
77        Numeric(super::ProtoNumeric),
78        #[prost(bytes, tag = "25")]
79        Uuid(::prost::alloc::vec::Vec<u8>),
80        #[prost(uint32, tag = "26")]
81        Uint32(u32),
82        #[prost(uint32, tag = "27")]
83        Uint8(u32),
84        #[prost(uint32, tag = "28")]
85        Uint16(u32),
86        #[prost(uint64, tag = "29")]
87        Uint64(u64),
88        #[prost(uint64, tag = "30")]
89        MzTimestamp(u64),
90        #[prost(message, tag = "31")]
91        Range(::prost::alloc::boxed::Box<super::ProtoRange>),
92        #[prost(message, tag = "32")]
93        MzAclItem(super::super::adt::mz_acl_item::ProtoMzAclItem),
94        #[prost(message, tag = "33")]
95        AclItem(super::super::adt::mz_acl_item::ProtoAclItem),
96    }
97}
98#[derive(Clone, PartialEq, ::prost::Message)]
99pub struct ProtoArray {
100    /// All array elements flattened into 1 dimension, encoded in row-major
101    /// order.
102    #[prost(message, optional, tag = "1")]
103    pub elements: ::core::option::Option<ProtoRow>,
104    /// A list of metadata for each dimension in the array. Each dimension has a
105    /// lower bound (the index at which the dimension begins) and the length of
106    /// the dimension (the number of elements in that dimension). For a 3x4
107    /// matrix, for example, you'd have two entries in the dims array, the first
108    /// with length 3 and the second with length 4. ATM the lower bound for each
109    /// dimension is always 1, but Postgres technically lets you choose any lower
110    /// bound you like for each dimension.
111    #[prost(message, repeated, tag = "2")]
112    pub dims: ::prost::alloc::vec::Vec<ProtoArrayDimension>,
113}
114#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
115pub struct ProtoArrayDimension {
116    #[prost(int64, tag = "1")]
117    pub lower_bound: i64,
118    #[prost(uint64, tag = "2")]
119    pub length: u64,
120}
121#[derive(Clone, PartialEq, ::prost::Message)]
122pub struct ProtoDict {
123    #[prost(message, repeated, tag = "1")]
124    pub elements: ::prost::alloc::vec::Vec<ProtoDictElement>,
125}
126#[derive(Clone, PartialEq, ::prost::Message)]
127pub struct ProtoDictElement {
128    #[prost(string, tag = "1")]
129    pub key: ::prost::alloc::string::String,
130    #[prost(message, optional, tag = "2")]
131    pub val: ::core::option::Option<ProtoDatum>,
132}
133/// See \[dec::to_packed_bcd\] and <http://speleotrove.com/decimal/dnpack.html> for
134/// more information on this format.
135///
136/// NB: Special values like NaN, PosInf, and NegInf are represented as variants
137/// of ProtoDatumOther.
138#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
139pub struct ProtoNumeric {
140    /// A a sequence of Binary Coded Decimal digits, most significant first (at
141    /// the lowest offset into the byte array) and one per 4 bits (that is, each
142    /// digit taking a value of 0–9, and two digits per byte), with optional
143    /// leading zero digits.
144    #[prost(bytes = "vec", tag = "1")]
145    pub bcd: ::prost::alloc::vec::Vec<u8>,
146    /// The number of digits that follow the decimal point.
147    #[prost(int32, tag = "2")]
148    pub scale: i32,
149}
150#[derive(Clone, PartialEq, ::prost::Message)]
151pub struct ProtoRangeInner {
152    #[prost(bool, tag = "1")]
153    pub lower_inclusive: bool,
154    #[prost(message, optional, boxed, tag = "2")]
155    pub lower: ::core::option::Option<::prost::alloc::boxed::Box<ProtoDatum>>,
156    #[prost(bool, tag = "3")]
157    pub upper_inclusive: bool,
158    #[prost(message, optional, boxed, tag = "4")]
159    pub upper: ::core::option::Option<::prost::alloc::boxed::Box<ProtoDatum>>,
160}
161#[derive(Clone, PartialEq, ::prost::Message)]
162pub struct ProtoRange {
163    #[prost(message, optional, boxed, tag = "1")]
164    pub inner: ::core::option::Option<::prost::alloc::boxed::Box<ProtoRangeInner>>,
165}
166#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
167#[repr(i32)]
168pub enum ProtoDatumOther {
169    /// It's generally good practice to make id 0 (the default if the field is
170    /// unset) in proto enums be an Unknown sentinel. This allows for
171    /// distinguishing between unset and any of the enum variants.
172    ///
173    /// This enum is initially used only in a oneof, which means we can
174    /// distinguish unset without this sentinel. But stick one in here anyway,
175    /// in case this enum gets used somewhere else in the future.
176    Unknown = 0,
177    Null = 1,
178    False = 2,
179    True = 3,
180    JsonNull = 4,
181    Dummy = 5,
182    NumericPosInf = 6,
183    NumericNegInf = 7,
184    NumericNaN = 8,
185}
186impl ProtoDatumOther {
187    /// String value of the enum field names used in the ProtoBuf definition.
188    ///
189    /// The values are not transformed in any way and thus are considered stable
190    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
191    pub fn as_str_name(&self) -> &'static str {
192        match self {
193            Self::Unknown => "UNKNOWN",
194            Self::Null => "NULL",
195            Self::False => "FALSE",
196            Self::True => "TRUE",
197            Self::JsonNull => "JSON_NULL",
198            Self::Dummy => "DUMMY",
199            Self::NumericPosInf => "NUMERIC_POS_INF",
200            Self::NumericNegInf => "NUMERIC_NEG_INF",
201            Self::NumericNaN => "NUMERIC_NA_N",
202        }
203    }
204    /// Creates an enum from field names used in the ProtoBuf definition.
205    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
206        match value {
207            "UNKNOWN" => Some(Self::Unknown),
208            "NULL" => Some(Self::Null),
209            "FALSE" => Some(Self::False),
210            "TRUE" => Some(Self::True),
211            "JSON_NULL" => Some(Self::JsonNull),
212            "DUMMY" => Some(Self::Dummy),
213            "NUMERIC_POS_INF" => Some(Self::NumericPosInf),
214            "NUMERIC_NEG_INF" => Some(Self::NumericNegInf),
215            "NUMERIC_NA_N" => Some(Self::NumericNaN),
216            _ => None,
217        }
218    }
219}