Skip to content

Commit

Permalink
Restore pb.rs
Browse files Browse the repository at this point in the history
  • Loading branch information
evensolberg committed Aug 18, 2023
1 parent c24eb79 commit a173a80
Showing 1 changed file with 10 additions and 20 deletions.
30 changes: 10 additions & 20 deletions src/gen/pb.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ pub struct Point {
#[prost(float, tag = "2")]
pub lat: f32,
}

/// Define a polygon, mostly based on `GeoJSON`'s Polygon define.
/// Define a polygon, mostly based on GeoJSON's Polygon define.
///
/// Excerpt from RFC-9476 section 'Polygon'
///
Expand Down Expand Up @@ -48,7 +47,6 @@ pub struct Polygon {
#[prost(message, repeated, tag = "2")]
pub holes: ::prost::alloc::vec::Vec<Polygon>,
}

/// Timezone is a timezone's all data.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
Expand All @@ -58,7 +56,6 @@ pub struct Timezone {
#[prost(string, tag = "2")]
pub name: ::prost::alloc::string::String,
}

#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Timezones {
Expand All @@ -70,7 +67,6 @@ pub struct Timezones {
#[prost(string, tag = "3")]
pub version: ::prost::alloc::string::String,
}

#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CompressedPolygon {
Expand All @@ -79,8 +75,7 @@ pub struct CompressedPolygon {
#[prost(message, repeated, tag = "2")]
pub holes: ::prost::alloc::vec::Vec<CompressedPolygon>,
}

/// `CompressedTimezonesItem` designed for binary file as small as possible.
/// CompressedTimezonesItem designed for binary file as small as possible.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CompressedTimezone {
Expand All @@ -89,7 +84,6 @@ pub struct CompressedTimezone {
#[prost(string, tag = "2")]
pub name: ::prost::alloc::string::String,
}

#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CompressedTimezones {
Expand All @@ -100,8 +94,7 @@ pub struct CompressedTimezones {
#[prost(string, tag = "3")]
pub version: ::prost::alloc::string::String,
}

/// `PreindexTimezone` tile item.
/// PreindexTimezone tile item.
///
/// The X/Y/Z are OSM style like map tile index values.
#[allow(clippy::derive_partial_eq_without_eq)]
Expand All @@ -116,8 +109,7 @@ pub struct PreindexTimezone {
#[prost(int32, tag = "4")]
pub z: i32,
}

/// `PreindexTimezones` is all preindex timezone's dumps.
/// PreindexTimezones is all preindex timezone's dumps.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PreindexTimezones {
Expand All @@ -132,7 +124,6 @@ pub struct PreindexTimezones {
#[prost(string, tag = "4")]
pub version: ::prost::alloc::string::String,
}

#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum CompressMethod {
Expand All @@ -141,18 +132,17 @@ pub enum CompressMethod {
Polyline = 1,
}
impl CompressMethod {
/// String value of the enum field names used in the `ProtoBuf` definition.
/// 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 const fn as_str_name(self) -> &'static str {
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Unknown => "Unknown",
Self::Polyline => "Polyline",
CompressMethod::Unknown => "Unknown",
CompressMethod::Polyline => "Polyline",
}
}

/// Creates an enum from field names used in the `ProtoBuf` definition.
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"Unknown" => Some(Self::Unknown),
Expand Down

0 comments on commit a173a80

Please sign in to comment.