Skip to main content

tinymvt/
vector_tile.rs

1// This file is @generated by prost-build.
2#[derive(Clone, PartialEq, ::prost::Message)]
3pub struct Tile {
4    #[prost(message, repeated, tag = "3")]
5    pub layers: ::prost::alloc::vec::Vec<tile::Layer>,
6}
7/// Nested message and enum types in `Tile`.
8pub mod tile {
9    /// Variant type encoding
10    /// The use of values is described in section 4.1 of the specification
11    #[derive(Clone, PartialEq, ::prost::Message)]
12    pub struct Value {
13        /// Exactly one of these values must be present in a valid message
14        #[prost(string, optional, tag = "1")]
15        pub string_value: ::core::option::Option<::prost::alloc::string::String>,
16        #[prost(float, optional, tag = "2")]
17        pub float_value: ::core::option::Option<f32>,
18        #[prost(double, optional, tag = "3")]
19        pub double_value: ::core::option::Option<f64>,
20        #[prost(int64, optional, tag = "4")]
21        pub int_value: ::core::option::Option<i64>,
22        #[prost(uint64, optional, tag = "5")]
23        pub uint_value: ::core::option::Option<u64>,
24        #[prost(sint64, optional, tag = "6")]
25        pub sint_value: ::core::option::Option<i64>,
26        #[prost(bool, optional, tag = "7")]
27        pub bool_value: ::core::option::Option<bool>,
28    }
29    /// Features are described in section 4.2 of the specification
30    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
31    pub struct Feature {
32        #[prost(uint64, optional, tag = "1", default = "0")]
33        pub id: ::core::option::Option<u64>,
34        /// Tags of this feature are encoded as repeated pairs of
35        /// integers.
36        /// A detailed description of tags is located in sections
37        /// 4.2 and 4.4 of the specification
38        #[prost(uint32, repeated, tag = "2")]
39        pub tags: ::prost::alloc::vec::Vec<u32>,
40        /// The type of geometry stored in this feature.
41        #[prost(enumeration = "GeomType", optional, tag = "3", default = "Unknown")]
42        pub r#type: ::core::option::Option<i32>,
43        /// Contains a stream of commands and parameters (vertices).
44        /// A detailed description on geometry encoding is located in
45        /// section 4.3 of the specification.
46        #[prost(uint32, repeated, tag = "4")]
47        pub geometry: ::prost::alloc::vec::Vec<u32>,
48    }
49    /// Layers are described in section 4.1 of the specification
50    #[derive(Clone, PartialEq, ::prost::Message)]
51    pub struct Layer {
52        /// Any compliant implementation must first read the version
53        /// number encoded in this message and choose the correct
54        /// implementation for this version number before proceeding to
55        /// decode other parts of this message.
56        #[prost(uint32, required, tag = "15", default = "1")]
57        pub version: u32,
58        #[prost(string, required, tag = "1")]
59        pub name: ::prost::alloc::string::String,
60        /// The actual features in this tile.
61        #[prost(message, repeated, tag = "2")]
62        pub features: ::prost::alloc::vec::Vec<Feature>,
63        /// Dictionary encoding for keys
64        #[prost(string, repeated, tag = "3")]
65        pub keys: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
66        /// Dictionary encoding for values
67        #[prost(message, repeated, tag = "4")]
68        pub values: ::prost::alloc::vec::Vec<Value>,
69        /// Although this is an "optional" field it is required by the specification.
70        /// See <https://github.com/mapbox/vector-tile-spec/issues/47>
71        #[prost(uint32, optional, tag = "5", default = "4096")]
72        pub extent: ::core::option::Option<u32>,
73    }
74    /// GeomType is described in section 4.3.4 of the specification
75    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
76    #[repr(i32)]
77    pub enum GeomType {
78        Unknown = 0,
79        Point = 1,
80        Linestring = 2,
81        Polygon = 3,
82    }
83    impl GeomType {
84        /// String value of the enum field names used in the ProtoBuf definition.
85        ///
86        /// The values are not transformed in any way and thus are considered stable
87        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
88        pub fn as_str_name(&self) -> &'static str {
89            match self {
90                Self::Unknown => "UNKNOWN",
91                Self::Point => "POINT",
92                Self::Linestring => "LINESTRING",
93                Self::Polygon => "POLYGON",
94            }
95        }
96        /// Creates an enum from field names used in the ProtoBuf definition.
97        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
98            match value {
99                "UNKNOWN" => Some(Self::Unknown),
100                "POINT" => Some(Self::Point),
101                "LINESTRING" => Some(Self::Linestring),
102                "POLYGON" => Some(Self::Polygon),
103                _ => None,
104            }
105        }
106    }
107}