tzf_rs/pbgen/
tzf.v1.rs

1// This file is @generated by prost-build.
2/// Basic point data define.
3#[derive(Clone, Copy, PartialEq, ::prost::Message)]
4pub struct Point {
5    #[prost(float, tag = "1")]
6    pub lng: f32,
7    #[prost(float, tag = "2")]
8    pub lat: f32,
9}
10/// Define a polygon, mostly based on GeoJSON's Polygon define.
11///
12/// Excerpt from RFC-9476 section 'Polygon'
13///
14///    -  A linear ring is a closed LineString with four or more positions.
15///    -  The first and last positions are equivalent, and they MUST contain
16///      identical values; their representation SHOULD also be identical.
17///    -  A linear ring is the boundary of a surface or the boundary of a
18///      hole in a surface.
19///    -  A linear ring MUST follow the right-hand rule with respect to the
20///      area it bounds, i.e., exterior rings are counterclockwise, and
21///      holes are clockwise.
22///
23///    Note: the \[GJ2008\] specification did not discuss linear ring winding
24///    order.  For backwards compatibility, parsers SHOULD NOT reject
25///    Polygons that do not follow the right-hand rule.
26///
27///    Though a linear ring is not explicitly represented as a GeoJSON
28///    geometry type, it leads to a canonical formulation of the Polygon
29///    geometry type definition as follows:
30///
31///    -  For type "Polygon", the "coordinates" member MUST be an array of
32///      linear ring coordinate arrays.
33///    -  For Polygons with more than one of these rings, the first MUST be
34///      the exterior ring, and any others MUST be interior rings.  The
35///      exterior ring bounds the surface, and the interior rings (if
36///      present) bound holes within the surface.
37///
38/// \[GJ2008\]: <https://geojson.org/geojson-spec>
39///
40#[derive(Clone, PartialEq, ::prost::Message)]
41pub struct Polygon {
42    /// define the "exterior ring"
43    #[prost(message, repeated, tag = "1")]
44    pub points: ::prost::alloc::vec::Vec<Point>,
45    /// define the "interior rings" as holes
46    #[prost(message, repeated, tag = "2")]
47    pub holes: ::prost::alloc::vec::Vec<Polygon>,
48}
49/// Timezone is a timezone's all data.
50#[derive(Clone, PartialEq, ::prost::Message)]
51pub struct Timezone {
52    #[prost(message, repeated, tag = "1")]
53    pub polygons: ::prost::alloc::vec::Vec<Polygon>,
54    #[prost(string, tag = "2")]
55    pub name: ::prost::alloc::string::String,
56}
57#[derive(Clone, PartialEq, ::prost::Message)]
58pub struct Timezones {
59    #[prost(message, repeated, tag = "1")]
60    pub timezones: ::prost::alloc::vec::Vec<Timezone>,
61    /// Reduced data will toggle neighbor search as plan b
62    #[prost(bool, tag = "2")]
63    pub reduced: bool,
64    #[prost(string, tag = "3")]
65    pub version: ::prost::alloc::string::String,
66}
67#[derive(Clone, PartialEq, ::prost::Message)]
68pub struct CompressedPolygon {
69    #[prost(bytes = "vec", tag = "1")]
70    pub points: ::prost::alloc::vec::Vec<u8>,
71    #[prost(message, repeated, tag = "2")]
72    pub holes: ::prost::alloc::vec::Vec<CompressedPolygon>,
73}
74/// CompressedTimezonesItem designed for binary file as small as possible.
75#[derive(Clone, PartialEq, ::prost::Message)]
76pub struct CompressedTimezone {
77    #[prost(message, repeated, tag = "1")]
78    pub data: ::prost::alloc::vec::Vec<CompressedPolygon>,
79    #[prost(string, tag = "2")]
80    pub name: ::prost::alloc::string::String,
81}
82#[derive(Clone, PartialEq, ::prost::Message)]
83pub struct CompressedTimezones {
84    #[prost(enumeration = "CompressMethod", tag = "1")]
85    pub method: i32,
86    #[prost(message, repeated, tag = "2")]
87    pub timezones: ::prost::alloc::vec::Vec<CompressedTimezone>,
88    #[prost(string, tag = "3")]
89    pub version: ::prost::alloc::string::String,
90}
91/// PreindexTimezone tile item.
92///
93/// The X/Y/Z are OSM style like map tile index values.
94#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
95pub struct PreindexTimezone {
96    #[prost(string, tag = "1")]
97    pub name: ::prost::alloc::string::String,
98    #[prost(int32, tag = "2")]
99    pub x: i32,
100    #[prost(int32, tag = "3")]
101    pub y: i32,
102    #[prost(int32, tag = "4")]
103    pub z: i32,
104}
105/// PreindexTimezones is all preindex timezone's dumps.
106#[derive(Clone, PartialEq, ::prost::Message)]
107pub struct PreindexTimezones {
108    /// which zoom value the tiles generated
109    #[prost(int32, tag = "1")]
110    pub idx_zoom: i32,
111    /// which zoom value the tiles merge up with.
112    #[prost(int32, tag = "2")]
113    pub agg_zoom: i32,
114    #[prost(message, repeated, tag = "3")]
115    pub keys: ::prost::alloc::vec::Vec<PreindexTimezone>,
116    #[prost(string, tag = "4")]
117    pub version: ::prost::alloc::string::String,
118}
119#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
120#[repr(i32)]
121pub enum CompressMethod {
122    Unspecified = 0,
123    /// <https://developers.google.com/maps/documentation/utilities/polylinealgorithm>
124    Polyline = 1,
125}
126impl CompressMethod {
127    /// String value of the enum field names used in the ProtoBuf definition.
128    ///
129    /// The values are not transformed in any way and thus are considered stable
130    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
131    pub fn as_str_name(&self) -> &'static str {
132        match self {
133            Self::Unspecified => "COMPRESS_METHOD_UNSPECIFIED",
134            Self::Polyline => "COMPRESS_METHOD_POLYLINE",
135        }
136    }
137    /// Creates an enum from field names used in the ProtoBuf definition.
138    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
139        match value {
140            "COMPRESS_METHOD_UNSPECIFIED" => Some(Self::Unspecified),
141            "COMPRESS_METHOD_POLYLINE" => Some(Self::Polyline),
142            _ => None,
143        }
144    }
145}