#[derive(Clone, PartialEq, Default)]
pub struct HeaderBlock {
pub bbox: ::buffa::MessageField<HeaderBBox, ::buffa::Inline<HeaderBBox>>,
pub required_features: ::buffa::alloc::vec::Vec<::buffa::alloc::string::String>,
pub optional_features: ::buffa::alloc::vec::Vec<::buffa::alloc::string::String>,
pub writingprogram: ::core::option::Option<::buffa::alloc::string::String>,
pub source: ::core::option::Option<::buffa::alloc::string::String>,
pub osmosis_replication_timestamp: ::core::option::Option<i64>,
pub osmosis_replication_sequence_number: ::core::option::Option<i64>,
pub osmosis_replication_base_url: ::core::option::Option<
::buffa::alloc::string::String,
>,
}
impl ::core::fmt::Debug for HeaderBlock {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("HeaderBlock")
.field("bbox", &self.bbox)
.field("required_features", &self.required_features)
.field("optional_features", &self.optional_features)
.field("writingprogram", &self.writingprogram)
.field("source", &self.source)
.field("osmosis_replication_timestamp", &self.osmosis_replication_timestamp)
.field(
"osmosis_replication_sequence_number",
&self.osmosis_replication_sequence_number,
)
.field("osmosis_replication_base_url", &self.osmosis_replication_base_url)
.finish()
}
}
impl HeaderBlock {
pub const TYPE_URL: &'static str = "type.googleapis.com/OSMPBF.HeaderBlock";
}
impl HeaderBlock {
#[must_use = "with_* setters return `self` by value; assign or chain the result"]
#[inline]
pub fn with_writingprogram(
mut self,
value: impl Into<::buffa::alloc::string::String>,
) -> Self {
self.writingprogram = Some(value.into());
self
}
#[must_use = "with_* setters return `self` by value; assign or chain the result"]
#[inline]
pub fn with_source(
mut self,
value: impl Into<::buffa::alloc::string::String>,
) -> Self {
self.source = Some(value.into());
self
}
#[must_use = "with_* setters return `self` by value; assign or chain the result"]
#[inline]
pub fn with_osmosis_replication_timestamp(mut self, value: i64) -> Self {
self.osmosis_replication_timestamp = Some(value);
self
}
#[must_use = "with_* setters return `self` by value; assign or chain the result"]
#[inline]
pub fn with_osmosis_replication_sequence_number(mut self, value: i64) -> Self {
self.osmosis_replication_sequence_number = Some(value);
self
}
#[must_use = "with_* setters return `self` by value; assign or chain the result"]
#[inline]
pub fn with_osmosis_replication_base_url(
mut self,
value: impl Into<::buffa::alloc::string::String>,
) -> Self {
self.osmosis_replication_base_url = Some(value.into());
self
}
}
::buffa::impl_default_instance!(HeaderBlock);
impl ::buffa::MessageName for HeaderBlock {
const PACKAGE: &'static str = "OSMPBF";
const NAME: &'static str = "HeaderBlock";
const FULL_NAME: &'static str = "OSMPBF.HeaderBlock";
const TYPE_URL: &'static str = "type.googleapis.com/OSMPBF.HeaderBlock";
}
impl ::buffa::Message for HeaderBlock {
#[allow(clippy::let_and_return)]
fn compute_size(&self, __cache: &mut ::buffa::SizeCache) -> u32 {
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
let mut size = 0u64;
if self.bbox.is_set() {
let __slot = __cache.reserve();
let inner_size = self.bbox.compute_size(__cache);
__cache.set(__slot, inner_size);
size
+= 1u64 + ::buffa::encoding::varint_len(inner_size as u64) as u64
+ inner_size as u64;
}
for v in &self.required_features {
size += 1u64 + ::buffa::types::string_encoded_len(v) as u64;
}
for v in &self.optional_features {
size += 1u64 + ::buffa::types::string_encoded_len(v) as u64;
}
if let Some(ref v) = self.writingprogram {
size += 2u64 + ::buffa::types::string_encoded_len(v) as u64;
}
if let Some(ref v) = self.source {
size += 2u64 + ::buffa::types::string_encoded_len(v) as u64;
}
if let Some(v) = self.osmosis_replication_timestamp {
size += 2u64 + ::buffa::types::int64_encoded_len(v) as u64;
}
if let Some(v) = self.osmosis_replication_sequence_number {
size += 2u64 + ::buffa::types::int64_encoded_len(v) as u64;
}
if let Some(ref v) = self.osmosis_replication_base_url {
size += 2u64 + ::buffa::types::string_encoded_len(v) as u64;
}
::buffa::saturate_size(size)
}
fn write_to(
&self,
__cache: &mut ::buffa::SizeCache,
buf: &mut impl ::buffa::EncodeSink,
) {
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
if self.bbox.is_set() {
::buffa::types::put_len_delimited_header(
1u32,
u64::from(__cache.consume_next()),
buf,
);
self.bbox.write_to(__cache, buf);
}
for v in &self.required_features {
::buffa::types::put_string_field(4u32, v, buf);
}
for v in &self.optional_features {
::buffa::types::put_string_field(5u32, v, buf);
}
if let Some(ref v) = self.writingprogram {
::buffa::types::put_string_field(16u32, v, buf);
}
if let Some(ref v) = self.source {
::buffa::types::put_string_field(17u32, v, buf);
}
if let Some(v) = self.osmosis_replication_timestamp {
::buffa::types::put_int64_field(32u32, v, buf);
}
if let Some(v) = self.osmosis_replication_sequence_number {
::buffa::types::put_int64_field(33u32, v, buf);
}
if let Some(ref v) = self.osmosis_replication_base_url {
::buffa::types::put_string_field(34u32, v, buf);
}
}
fn merge_field(
&mut self,
tag: ::buffa::encoding::Tag,
buf: &mut impl ::buffa::bytes::Buf,
ctx: ::buffa::DecodeContext<'_>,
) -> ::core::result::Result<(), ::buffa::DecodeError> {
#[allow(unused_imports)]
use ::buffa::bytes::Buf as _;
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
match tag.field_number() {
1u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::LengthDelimited,
)?;
::buffa::Message::merge_length_delimited(
self.bbox.get_or_insert_default(),
buf,
ctx,
)?;
}
4u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::LengthDelimited,
)?;
let __elem = ::buffa::types::decode_string(buf)?;
ctx.register_element_memory(
::buffa::__private::element_footprint(&__elem),
)?;
self.required_features.push(__elem);
}
5u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::LengthDelimited,
)?;
let __elem = ::buffa::types::decode_string(buf)?;
ctx.register_element_memory(
::buffa::__private::element_footprint(&__elem),
)?;
self.optional_features.push(__elem);
}
16u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::LengthDelimited,
)?;
::buffa::types::merge_string(
self
.writingprogram
.get_or_insert_with(::buffa::alloc::string::String::new),
buf,
)?;
}
17u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::LengthDelimited,
)?;
::buffa::types::merge_string(
self.source.get_or_insert_with(::buffa::alloc::string::String::new),
buf,
)?;
}
32u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::Varint,
)?;
self.osmosis_replication_timestamp = ::core::option::Option::Some(
::buffa::types::decode_int64(buf)?,
);
}
33u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::Varint,
)?;
self.osmosis_replication_sequence_number = ::core::option::Option::Some(
::buffa::types::decode_int64(buf)?,
);
}
34u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::LengthDelimited,
)?;
::buffa::types::merge_string(
self
.osmosis_replication_base_url
.get_or_insert_with(::buffa::alloc::string::String::new),
buf,
)?;
}
_ => {
::buffa::encoding::skip_field_depth(tag, buf, ctx.depth())?;
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.bbox = ::buffa::MessageField::none();
self.required_features.clear();
self.optional_features.clear();
self.writingprogram = ::core::option::Option::None;
self.source = ::core::option::Option::None;
self.osmosis_replication_timestamp = ::core::option::Option::None;
self.osmosis_replication_sequence_number = ::core::option::Option::None;
self.osmosis_replication_base_url = ::core::option::Option::None;
}
}
#[derive(Clone, PartialEq, Default)]
pub struct HeaderBBox {
pub left: i64,
pub right: i64,
pub top: i64,
pub bottom: i64,
}
impl ::core::fmt::Debug for HeaderBBox {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("HeaderBBox")
.field("left", &self.left)
.field("right", &self.right)
.field("top", &self.top)
.field("bottom", &self.bottom)
.finish()
}
}
impl HeaderBBox {
pub const TYPE_URL: &'static str = "type.googleapis.com/OSMPBF.HeaderBBox";
}
::buffa::impl_default_instance!(HeaderBBox);
impl ::buffa::MessageName for HeaderBBox {
const PACKAGE: &'static str = "OSMPBF";
const NAME: &'static str = "HeaderBBox";
const FULL_NAME: &'static str = "OSMPBF.HeaderBBox";
const TYPE_URL: &'static str = "type.googleapis.com/OSMPBF.HeaderBBox";
}
impl ::buffa::Message for HeaderBBox {
#[allow(clippy::let_and_return)]
fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
let mut size = 0u64;
size += 1u64 + ::buffa::types::sint64_encoded_len(self.left) as u64;
size += 1u64 + ::buffa::types::sint64_encoded_len(self.right) as u64;
size += 1u64 + ::buffa::types::sint64_encoded_len(self.top) as u64;
size += 1u64 + ::buffa::types::sint64_encoded_len(self.bottom) as u64;
::buffa::saturate_size(size)
}
fn write_to(
&self,
_cache: &mut ::buffa::SizeCache,
buf: &mut impl ::buffa::EncodeSink,
) {
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
::buffa::types::put_sint64_field(1u32, self.left, buf);
::buffa::types::put_sint64_field(2u32, self.right, buf);
::buffa::types::put_sint64_field(3u32, self.top, buf);
::buffa::types::put_sint64_field(4u32, self.bottom, buf);
}
fn merge_field(
&mut self,
tag: ::buffa::encoding::Tag,
buf: &mut impl ::buffa::bytes::Buf,
ctx: ::buffa::DecodeContext<'_>,
) -> ::core::result::Result<(), ::buffa::DecodeError> {
#[allow(unused_imports)]
use ::buffa::bytes::Buf as _;
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
match tag.field_number() {
1u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::Varint,
)?;
self.left = ::buffa::types::decode_sint64(buf)?;
}
2u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::Varint,
)?;
self.right = ::buffa::types::decode_sint64(buf)?;
}
3u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::Varint,
)?;
self.top = ::buffa::types::decode_sint64(buf)?;
}
4u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::Varint,
)?;
self.bottom = ::buffa::types::decode_sint64(buf)?;
}
_ => {
::buffa::encoding::skip_field_depth(tag, buf, ctx.depth())?;
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.left = 0i64;
self.right = 0i64;
self.top = 0i64;
self.bottom = 0i64;
}
}
#[derive(Clone, PartialEq, Default)]
pub struct PrimitiveBlock {
pub stringtable: ::buffa::MessageField<StringTable, ::buffa::Inline<StringTable>>,
pub primitivegroup: ::buffa::alloc::vec::Vec<PrimitiveGroup>,
pub granularity: ::core::option::Option<i32>,
pub lat_offset: ::core::option::Option<i64>,
pub lon_offset: ::core::option::Option<i64>,
pub date_granularity: ::core::option::Option<i32>,
}
impl ::core::fmt::Debug for PrimitiveBlock {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("PrimitiveBlock")
.field("stringtable", &self.stringtable)
.field("primitivegroup", &self.primitivegroup)
.field("granularity", &self.granularity)
.field("lat_offset", &self.lat_offset)
.field("lon_offset", &self.lon_offset)
.field("date_granularity", &self.date_granularity)
.finish()
}
}
impl PrimitiveBlock {
pub const TYPE_URL: &'static str = "type.googleapis.com/OSMPBF.PrimitiveBlock";
}
impl PrimitiveBlock {
#[must_use = "with_* setters return `self` by value; assign or chain the result"]
#[inline]
pub fn with_granularity(mut self, value: i32) -> Self {
self.granularity = Some(value);
self
}
#[must_use = "with_* setters return `self` by value; assign or chain the result"]
#[inline]
pub fn with_lat_offset(mut self, value: i64) -> Self {
self.lat_offset = Some(value);
self
}
#[must_use = "with_* setters return `self` by value; assign or chain the result"]
#[inline]
pub fn with_lon_offset(mut self, value: i64) -> Self {
self.lon_offset = Some(value);
self
}
#[must_use = "with_* setters return `self` by value; assign or chain the result"]
#[inline]
pub fn with_date_granularity(mut self, value: i32) -> Self {
self.date_granularity = Some(value);
self
}
}
::buffa::impl_default_instance!(PrimitiveBlock);
impl ::buffa::MessageName for PrimitiveBlock {
const PACKAGE: &'static str = "OSMPBF";
const NAME: &'static str = "PrimitiveBlock";
const FULL_NAME: &'static str = "OSMPBF.PrimitiveBlock";
const TYPE_URL: &'static str = "type.googleapis.com/OSMPBF.PrimitiveBlock";
}
impl ::buffa::Message for PrimitiveBlock {
#[allow(clippy::let_and_return)]
fn compute_size(&self, __cache: &mut ::buffa::SizeCache) -> u32 {
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
let mut size = 0u64;
if self.stringtable.is_set() {
let __slot = __cache.reserve();
let inner_size = self.stringtable.compute_size(__cache);
__cache.set(__slot, inner_size);
size
+= 1u64 + ::buffa::encoding::varint_len(inner_size as u64) as u64
+ inner_size as u64;
}
for v in &self.primitivegroup {
let __slot = __cache.reserve();
let inner_size = v.compute_size(__cache);
__cache.set(__slot, inner_size);
size
+= 1u64 + ::buffa::encoding::varint_len(inner_size as u64) as u64
+ inner_size as u64;
}
if let Some(v) = self.granularity {
size += 2u64 + ::buffa::types::int32_encoded_len(v) as u64;
}
if let Some(v) = self.date_granularity {
size += 2u64 + ::buffa::types::int32_encoded_len(v) as u64;
}
if let Some(v) = self.lat_offset {
size += 2u64 + ::buffa::types::int64_encoded_len(v) as u64;
}
if let Some(v) = self.lon_offset {
size += 2u64 + ::buffa::types::int64_encoded_len(v) as u64;
}
::buffa::saturate_size(size)
}
fn write_to(
&self,
__cache: &mut ::buffa::SizeCache,
buf: &mut impl ::buffa::EncodeSink,
) {
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
if self.stringtable.is_set() {
::buffa::types::put_len_delimited_header(
1u32,
u64::from(__cache.consume_next()),
buf,
);
self.stringtable.write_to(__cache, buf);
}
for v in &self.primitivegroup {
::buffa::types::put_len_delimited_header(
2u32,
u64::from(__cache.consume_next()),
buf,
);
v.write_to(__cache, buf);
}
if let Some(v) = self.granularity {
::buffa::types::put_int32_field(17u32, v, buf);
}
if let Some(v) = self.date_granularity {
::buffa::types::put_int32_field(18u32, v, buf);
}
if let Some(v) = self.lat_offset {
::buffa::types::put_int64_field(19u32, v, buf);
}
if let Some(v) = self.lon_offset {
::buffa::types::put_int64_field(20u32, v, buf);
}
}
fn merge_field(
&mut self,
tag: ::buffa::encoding::Tag,
buf: &mut impl ::buffa::bytes::Buf,
ctx: ::buffa::DecodeContext<'_>,
) -> ::core::result::Result<(), ::buffa::DecodeError> {
#[allow(unused_imports)]
use ::buffa::bytes::Buf as _;
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
match tag.field_number() {
1u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::LengthDelimited,
)?;
::buffa::Message::merge_length_delimited(
self.stringtable.get_or_insert_default(),
buf,
ctx,
)?;
}
2u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::LengthDelimited,
)?;
let mut elem = ::core::default::Default::default();
ctx.register_element_memory(
::buffa::__private::element_footprint(&elem),
)?;
::buffa::Message::merge_length_delimited(&mut elem, buf, ctx)?;
self.primitivegroup.push(elem);
}
17u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::Varint,
)?;
self.granularity = ::core::option::Option::Some(
::buffa::types::decode_int32(buf)?,
);
}
18u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::Varint,
)?;
self.date_granularity = ::core::option::Option::Some(
::buffa::types::decode_int32(buf)?,
);
}
19u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::Varint,
)?;
self.lat_offset = ::core::option::Option::Some(
::buffa::types::decode_int64(buf)?,
);
}
20u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::Varint,
)?;
self.lon_offset = ::core::option::Option::Some(
::buffa::types::decode_int64(buf)?,
);
}
_ => {
::buffa::encoding::skip_field_depth(tag, buf, ctx.depth())?;
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.stringtable = ::buffa::MessageField::none();
self.primitivegroup.clear();
self.granularity = ::core::option::Option::None;
self.date_granularity = ::core::option::Option::None;
self.lat_offset = ::core::option::Option::None;
self.lon_offset = ::core::option::Option::None;
}
}
#[derive(Clone, PartialEq, Default)]
pub struct PrimitiveGroup {
pub nodes: ::buffa::alloc::vec::Vec<Node>,
pub dense: ::buffa::MessageField<DenseNodes, ::buffa::Inline<DenseNodes>>,
pub ways: ::buffa::alloc::vec::Vec<Way>,
pub relations: ::buffa::alloc::vec::Vec<Relation>,
pub changesets: ::buffa::alloc::vec::Vec<ChangeSet>,
}
impl ::core::fmt::Debug for PrimitiveGroup {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("PrimitiveGroup")
.field("nodes", &self.nodes)
.field("dense", &self.dense)
.field("ways", &self.ways)
.field("relations", &self.relations)
.field("changesets", &self.changesets)
.finish()
}
}
impl PrimitiveGroup {
pub const TYPE_URL: &'static str = "type.googleapis.com/OSMPBF.PrimitiveGroup";
}
::buffa::impl_default_instance!(PrimitiveGroup);
impl ::buffa::MessageName for PrimitiveGroup {
const PACKAGE: &'static str = "OSMPBF";
const NAME: &'static str = "PrimitiveGroup";
const FULL_NAME: &'static str = "OSMPBF.PrimitiveGroup";
const TYPE_URL: &'static str = "type.googleapis.com/OSMPBF.PrimitiveGroup";
}
impl ::buffa::Message for PrimitiveGroup {
#[allow(clippy::let_and_return)]
fn compute_size(&self, __cache: &mut ::buffa::SizeCache) -> u32 {
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
let mut size = 0u64;
for v in &self.nodes {
let __slot = __cache.reserve();
let inner_size = v.compute_size(__cache);
__cache.set(__slot, inner_size);
size
+= 1u64 + ::buffa::encoding::varint_len(inner_size as u64) as u64
+ inner_size as u64;
}
if self.dense.is_set() {
let __slot = __cache.reserve();
let inner_size = self.dense.compute_size(__cache);
__cache.set(__slot, inner_size);
size
+= 1u64 + ::buffa::encoding::varint_len(inner_size as u64) as u64
+ inner_size as u64;
}
for v in &self.ways {
let __slot = __cache.reserve();
let inner_size = v.compute_size(__cache);
__cache.set(__slot, inner_size);
size
+= 1u64 + ::buffa::encoding::varint_len(inner_size as u64) as u64
+ inner_size as u64;
}
for v in &self.relations {
let __slot = __cache.reserve();
let inner_size = v.compute_size(__cache);
__cache.set(__slot, inner_size);
size
+= 1u64 + ::buffa::encoding::varint_len(inner_size as u64) as u64
+ inner_size as u64;
}
for v in &self.changesets {
let __slot = __cache.reserve();
let inner_size = v.compute_size(__cache);
__cache.set(__slot, inner_size);
size
+= 1u64 + ::buffa::encoding::varint_len(inner_size as u64) as u64
+ inner_size as u64;
}
::buffa::saturate_size(size)
}
fn write_to(
&self,
__cache: &mut ::buffa::SizeCache,
buf: &mut impl ::buffa::EncodeSink,
) {
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
for v in &self.nodes {
::buffa::types::put_len_delimited_header(
1u32,
u64::from(__cache.consume_next()),
buf,
);
v.write_to(__cache, buf);
}
if self.dense.is_set() {
::buffa::types::put_len_delimited_header(
2u32,
u64::from(__cache.consume_next()),
buf,
);
self.dense.write_to(__cache, buf);
}
for v in &self.ways {
::buffa::types::put_len_delimited_header(
3u32,
u64::from(__cache.consume_next()),
buf,
);
v.write_to(__cache, buf);
}
for v in &self.relations {
::buffa::types::put_len_delimited_header(
4u32,
u64::from(__cache.consume_next()),
buf,
);
v.write_to(__cache, buf);
}
for v in &self.changesets {
::buffa::types::put_len_delimited_header(
5u32,
u64::from(__cache.consume_next()),
buf,
);
v.write_to(__cache, buf);
}
}
fn merge_field(
&mut self,
tag: ::buffa::encoding::Tag,
buf: &mut impl ::buffa::bytes::Buf,
ctx: ::buffa::DecodeContext<'_>,
) -> ::core::result::Result<(), ::buffa::DecodeError> {
#[allow(unused_imports)]
use ::buffa::bytes::Buf as _;
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
match tag.field_number() {
1u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::LengthDelimited,
)?;
let mut elem = ::core::default::Default::default();
ctx.register_element_memory(
::buffa::__private::element_footprint(&elem),
)?;
::buffa::Message::merge_length_delimited(&mut elem, buf, ctx)?;
self.nodes.push(elem);
}
2u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::LengthDelimited,
)?;
::buffa::Message::merge_length_delimited(
self.dense.get_or_insert_default(),
buf,
ctx,
)?;
}
3u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::LengthDelimited,
)?;
let mut elem = ::core::default::Default::default();
ctx.register_element_memory(
::buffa::__private::element_footprint(&elem),
)?;
::buffa::Message::merge_length_delimited(&mut elem, buf, ctx)?;
self.ways.push(elem);
}
4u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::LengthDelimited,
)?;
let mut elem = ::core::default::Default::default();
ctx.register_element_memory(
::buffa::__private::element_footprint(&elem),
)?;
::buffa::Message::merge_length_delimited(&mut elem, buf, ctx)?;
self.relations.push(elem);
}
5u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::LengthDelimited,
)?;
let mut elem = ::core::default::Default::default();
ctx.register_element_memory(
::buffa::__private::element_footprint(&elem),
)?;
::buffa::Message::merge_length_delimited(&mut elem, buf, ctx)?;
self.changesets.push(elem);
}
_ => {
::buffa::encoding::skip_field_depth(tag, buf, ctx.depth())?;
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.nodes.clear();
self.dense = ::buffa::MessageField::none();
self.ways.clear();
self.relations.clear();
self.changesets.clear();
}
}
#[derive(Clone, PartialEq, Default)]
pub struct StringTable {
pub s: ::buffa::alloc::vec::Vec<::buffa::alloc::vec::Vec<u8>>,
}
impl ::core::fmt::Debug for StringTable {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("StringTable").field("s", &self.s).finish()
}
}
impl StringTable {
pub const TYPE_URL: &'static str = "type.googleapis.com/OSMPBF.StringTable";
}
::buffa::impl_default_instance!(StringTable);
impl ::buffa::MessageName for StringTable {
const PACKAGE: &'static str = "OSMPBF";
const NAME: &'static str = "StringTable";
const FULL_NAME: &'static str = "OSMPBF.StringTable";
const TYPE_URL: &'static str = "type.googleapis.com/OSMPBF.StringTable";
}
impl ::buffa::Message for StringTable {
#[allow(clippy::let_and_return)]
fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
let mut size = 0u64;
for v in &self.s {
size += 1u64 + ::buffa::types::bytes_encoded_len(v) as u64;
}
::buffa::saturate_size(size)
}
fn write_to(
&self,
_cache: &mut ::buffa::SizeCache,
buf: &mut impl ::buffa::EncodeSink,
) {
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
for v in &self.s {
::buffa::types::put_shared_bytes_field(1u32, v, buf);
}
}
fn merge_field(
&mut self,
tag: ::buffa::encoding::Tag,
buf: &mut impl ::buffa::bytes::Buf,
ctx: ::buffa::DecodeContext<'_>,
) -> ::core::result::Result<(), ::buffa::DecodeError> {
#[allow(unused_imports)]
use ::buffa::bytes::Buf as _;
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
match tag.field_number() {
1u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::LengthDelimited,
)?;
let __elem = ::buffa::types::decode_bytes(buf)?;
ctx.register_element_memory(
::buffa::__private::element_footprint(&__elem),
)?;
self.s.push(__elem);
}
_ => {
::buffa::encoding::skip_field_depth(tag, buf, ctx.depth())?;
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.s.clear();
}
}
#[derive(Clone, PartialEq, Default)]
pub struct Info {
pub version: ::core::option::Option<i32>,
pub timestamp: ::core::option::Option<i64>,
pub changeset: ::core::option::Option<i64>,
pub uid: ::core::option::Option<i32>,
pub user_sid: ::core::option::Option<u32>,
pub visible: ::core::option::Option<bool>,
}
impl ::core::fmt::Debug for Info {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("Info")
.field("version", &self.version)
.field("timestamp", &self.timestamp)
.field("changeset", &self.changeset)
.field("uid", &self.uid)
.field("user_sid", &self.user_sid)
.field("visible", &self.visible)
.finish()
}
}
impl Info {
pub const TYPE_URL: &'static str = "type.googleapis.com/OSMPBF.Info";
}
impl Info {
#[must_use = "with_* setters return `self` by value; assign or chain the result"]
#[inline]
pub fn with_version(mut self, value: i32) -> Self {
self.version = Some(value);
self
}
#[must_use = "with_* setters return `self` by value; assign or chain the result"]
#[inline]
pub fn with_timestamp(mut self, value: i64) -> Self {
self.timestamp = Some(value);
self
}
#[must_use = "with_* setters return `self` by value; assign or chain the result"]
#[inline]
pub fn with_changeset(mut self, value: i64) -> Self {
self.changeset = Some(value);
self
}
#[must_use = "with_* setters return `self` by value; assign or chain the result"]
#[inline]
pub fn with_uid(mut self, value: i32) -> Self {
self.uid = Some(value);
self
}
#[must_use = "with_* setters return `self` by value; assign or chain the result"]
#[inline]
pub fn with_user_sid(mut self, value: u32) -> Self {
self.user_sid = Some(value);
self
}
#[must_use = "with_* setters return `self` by value; assign or chain the result"]
#[inline]
pub fn with_visible(mut self, value: bool) -> Self {
self.visible = Some(value);
self
}
}
::buffa::impl_default_instance!(Info);
impl ::buffa::MessageName for Info {
const PACKAGE: &'static str = "OSMPBF";
const NAME: &'static str = "Info";
const FULL_NAME: &'static str = "OSMPBF.Info";
const TYPE_URL: &'static str = "type.googleapis.com/OSMPBF.Info";
}
impl ::buffa::Message for Info {
#[allow(clippy::let_and_return)]
fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
let mut size = 0u64;
if let Some(v) = self.version {
size += 1u64 + ::buffa::types::int32_encoded_len(v) as u64;
}
if let Some(v) = self.timestamp {
size += 1u64 + ::buffa::types::int64_encoded_len(v) as u64;
}
if let Some(v) = self.changeset {
size += 1u64 + ::buffa::types::int64_encoded_len(v) as u64;
}
if let Some(v) = self.uid {
size += 1u64 + ::buffa::types::int32_encoded_len(v) as u64;
}
if let Some(v) = self.user_sid {
size += 1u64 + ::buffa::types::uint32_encoded_len(v) as u64;
}
if self.visible.is_some() {
size += 1u64 + ::buffa::types::BOOL_ENCODED_LEN as u64;
}
::buffa::saturate_size(size)
}
fn write_to(
&self,
_cache: &mut ::buffa::SizeCache,
buf: &mut impl ::buffa::EncodeSink,
) {
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
if let Some(v) = self.version {
::buffa::types::put_int32_field(1u32, v, buf);
}
if let Some(v) = self.timestamp {
::buffa::types::put_int64_field(2u32, v, buf);
}
if let Some(v) = self.changeset {
::buffa::types::put_int64_field(3u32, v, buf);
}
if let Some(v) = self.uid {
::buffa::types::put_int32_field(4u32, v, buf);
}
if let Some(v) = self.user_sid {
::buffa::types::put_uint32_field(5u32, v, buf);
}
if let Some(v) = self.visible {
::buffa::types::put_bool_field(6u32, v, buf);
}
}
fn merge_field(
&mut self,
tag: ::buffa::encoding::Tag,
buf: &mut impl ::buffa::bytes::Buf,
ctx: ::buffa::DecodeContext<'_>,
) -> ::core::result::Result<(), ::buffa::DecodeError> {
#[allow(unused_imports)]
use ::buffa::bytes::Buf as _;
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
match tag.field_number() {
1u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::Varint,
)?;
self.version = ::core::option::Option::Some(
::buffa::types::decode_int32(buf)?,
);
}
2u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::Varint,
)?;
self.timestamp = ::core::option::Option::Some(
::buffa::types::decode_int64(buf)?,
);
}
3u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::Varint,
)?;
self.changeset = ::core::option::Option::Some(
::buffa::types::decode_int64(buf)?,
);
}
4u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::Varint,
)?;
self.uid = ::core::option::Option::Some(
::buffa::types::decode_int32(buf)?,
);
}
5u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::Varint,
)?;
self.user_sid = ::core::option::Option::Some(
::buffa::types::decode_uint32(buf)?,
);
}
6u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::Varint,
)?;
self.visible = ::core::option::Option::Some(
::buffa::types::decode_bool(buf)?,
);
}
_ => {
::buffa::encoding::skip_field_depth(tag, buf, ctx.depth())?;
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.version = ::core::option::Option::None;
self.timestamp = ::core::option::Option::None;
self.changeset = ::core::option::Option::None;
self.uid = ::core::option::Option::None;
self.user_sid = ::core::option::Option::None;
self.visible = ::core::option::Option::None;
}
}
#[derive(Clone, PartialEq, Default)]
pub struct DenseInfo {
pub version: ::buffa::alloc::vec::Vec<i32>,
pub timestamp: ::buffa::alloc::vec::Vec<i64>,
pub changeset: ::buffa::alloc::vec::Vec<i64>,
pub uid: ::buffa::alloc::vec::Vec<i32>,
pub user_sid: ::buffa::alloc::vec::Vec<i32>,
pub visible: ::buffa::alloc::vec::Vec<bool>,
}
impl ::core::fmt::Debug for DenseInfo {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("DenseInfo")
.field("version", &self.version)
.field("timestamp", &self.timestamp)
.field("changeset", &self.changeset)
.field("uid", &self.uid)
.field("user_sid", &self.user_sid)
.field("visible", &self.visible)
.finish()
}
}
impl DenseInfo {
pub const TYPE_URL: &'static str = "type.googleapis.com/OSMPBF.DenseInfo";
}
::buffa::impl_default_instance!(DenseInfo);
impl ::buffa::MessageName for DenseInfo {
const PACKAGE: &'static str = "OSMPBF";
const NAME: &'static str = "DenseInfo";
const FULL_NAME: &'static str = "OSMPBF.DenseInfo";
const TYPE_URL: &'static str = "type.googleapis.com/OSMPBF.DenseInfo";
}
impl ::buffa::Message for DenseInfo {
#[allow(clippy::let_and_return)]
fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
let mut size = 0u64;
if !self.version.is_empty() {
let payload: u64 = self
.version
.iter()
.map(|&v| ::buffa::types::int32_encoded_len(v) as u64)
.sum::<u64>();
size += 1u64 + ::buffa::encoding::varint_len(payload) as u64 + payload;
}
if !self.timestamp.is_empty() {
let payload: u64 = self
.timestamp
.iter()
.map(|&v| ::buffa::types::sint64_encoded_len(v) as u64)
.sum::<u64>();
size += 1u64 + ::buffa::encoding::varint_len(payload) as u64 + payload;
}
if !self.changeset.is_empty() {
let payload: u64 = self
.changeset
.iter()
.map(|&v| ::buffa::types::sint64_encoded_len(v) as u64)
.sum::<u64>();
size += 1u64 + ::buffa::encoding::varint_len(payload) as u64 + payload;
}
if !self.uid.is_empty() {
let payload: u64 = self
.uid
.iter()
.map(|&v| ::buffa::types::sint32_encoded_len(v) as u64)
.sum::<u64>();
size += 1u64 + ::buffa::encoding::varint_len(payload) as u64 + payload;
}
if !self.user_sid.is_empty() {
let payload: u64 = self
.user_sid
.iter()
.map(|&v| ::buffa::types::sint32_encoded_len(v) as u64)
.sum::<u64>();
size += 1u64 + ::buffa::encoding::varint_len(payload) as u64 + payload;
}
if !self.visible.is_empty() {
let payload: u64 = self.visible.len() as u64
* ::buffa::types::BOOL_ENCODED_LEN as u64;
size += 1u64 + ::buffa::encoding::varint_len(payload) as u64 + payload;
}
::buffa::saturate_size(size)
}
fn write_to(
&self,
_cache: &mut ::buffa::SizeCache,
buf: &mut impl ::buffa::EncodeSink,
) {
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
if !self.version.is_empty() {
let payload: u64 = self
.version
.iter()
.map(|&v| ::buffa::types::int32_encoded_len(v) as u64)
.sum::<u64>();
::buffa::types::put_len_delimited_header(1u32, payload, buf);
for &v in &self.version {
::buffa::types::encode_int32(v, buf);
}
}
if !self.timestamp.is_empty() {
let payload: u64 = self
.timestamp
.iter()
.map(|&v| ::buffa::types::sint64_encoded_len(v) as u64)
.sum::<u64>();
::buffa::types::put_len_delimited_header(2u32, payload, buf);
for &v in &self.timestamp {
::buffa::types::encode_sint64(v, buf);
}
}
if !self.changeset.is_empty() {
let payload: u64 = self
.changeset
.iter()
.map(|&v| ::buffa::types::sint64_encoded_len(v) as u64)
.sum::<u64>();
::buffa::types::put_len_delimited_header(3u32, payload, buf);
for &v in &self.changeset {
::buffa::types::encode_sint64(v, buf);
}
}
if !self.uid.is_empty() {
let payload: u64 = self
.uid
.iter()
.map(|&v| ::buffa::types::sint32_encoded_len(v) as u64)
.sum::<u64>();
::buffa::types::put_len_delimited_header(4u32, payload, buf);
for &v in &self.uid {
::buffa::types::encode_sint32(v, buf);
}
}
if !self.user_sid.is_empty() {
let payload: u64 = self
.user_sid
.iter()
.map(|&v| ::buffa::types::sint32_encoded_len(v) as u64)
.sum::<u64>();
::buffa::types::put_len_delimited_header(5u32, payload, buf);
for &v in &self.user_sid {
::buffa::types::encode_sint32(v, buf);
}
}
if !self.visible.is_empty() {
let payload: u64 = self.visible.len() as u64
* ::buffa::types::BOOL_ENCODED_LEN as u64;
::buffa::types::put_len_delimited_header(6u32, payload, buf);
for &v in &self.visible {
::buffa::types::encode_bool(v, buf);
}
}
}
fn merge_field(
&mut self,
tag: ::buffa::encoding::Tag,
buf: &mut impl ::buffa::bytes::Buf,
ctx: ::buffa::DecodeContext<'_>,
) -> ::core::result::Result<(), ::buffa::DecodeError> {
#[allow(unused_imports)]
use ::buffa::bytes::Buf as _;
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
match tag.field_number() {
1u32 => {
if tag.wire_type() == ::buffa::encoding::WireType::LengthDelimited {
let len = ::buffa::encoding::decode_varint(buf)?;
let len = usize::try_from(len)
.map_err(|_| ::buffa::DecodeError::MessageTooLarge)?;
if buf.remaining() < len {
return ::core::result::Result::Err(
::buffa::DecodeError::UnexpectedEof,
);
}
if buf.chunk().len() >= len {
::buffa::types::extend_packed_int32(
&buf.chunk()[..len],
&mut self.version,
len,
)?;
buf.advance(len);
} else {
self.version.reserve(len);
let mut limited = buf.take(len);
while limited.has_remaining() {
self.version
.push(::buffa::types::decode_int32_packed(&mut limited)?);
}
let leftover = limited.remaining();
if leftover > 0 {
limited.advance(leftover);
}
}
} else if tag.wire_type() == ::buffa::encoding::WireType::Varint {
self.version.push(::buffa::types::decode_int32(buf)?);
} else {
return ::core::result::Result::Err(
::buffa::encoding::wire_type_mismatch(
tag,
::buffa::encoding::WireType::LengthDelimited,
),
);
}
}
2u32 => {
if tag.wire_type() == ::buffa::encoding::WireType::LengthDelimited {
let len = ::buffa::encoding::decode_varint(buf)?;
let len = usize::try_from(len)
.map_err(|_| ::buffa::DecodeError::MessageTooLarge)?;
if buf.remaining() < len {
return ::core::result::Result::Err(
::buffa::DecodeError::UnexpectedEof,
);
}
if buf.chunk().len() >= len {
::buffa::types::extend_packed_sint64(
&buf.chunk()[..len],
&mut self.timestamp,
len,
)?;
buf.advance(len);
} else {
self.timestamp.reserve(len);
let mut limited = buf.take(len);
while limited.has_remaining() {
self.timestamp
.push(::buffa::types::decode_sint64_packed(&mut limited)?);
}
let leftover = limited.remaining();
if leftover > 0 {
limited.advance(leftover);
}
}
} else if tag.wire_type() == ::buffa::encoding::WireType::Varint {
self.timestamp.push(::buffa::types::decode_sint64(buf)?);
} else {
return ::core::result::Result::Err(
::buffa::encoding::wire_type_mismatch(
tag,
::buffa::encoding::WireType::LengthDelimited,
),
);
}
}
3u32 => {
if tag.wire_type() == ::buffa::encoding::WireType::LengthDelimited {
let len = ::buffa::encoding::decode_varint(buf)?;
let len = usize::try_from(len)
.map_err(|_| ::buffa::DecodeError::MessageTooLarge)?;
if buf.remaining() < len {
return ::core::result::Result::Err(
::buffa::DecodeError::UnexpectedEof,
);
}
if buf.chunk().len() >= len {
::buffa::types::extend_packed_sint64(
&buf.chunk()[..len],
&mut self.changeset,
len,
)?;
buf.advance(len);
} else {
self.changeset.reserve(len);
let mut limited = buf.take(len);
while limited.has_remaining() {
self.changeset
.push(::buffa::types::decode_sint64_packed(&mut limited)?);
}
let leftover = limited.remaining();
if leftover > 0 {
limited.advance(leftover);
}
}
} else if tag.wire_type() == ::buffa::encoding::WireType::Varint {
self.changeset.push(::buffa::types::decode_sint64(buf)?);
} else {
return ::core::result::Result::Err(
::buffa::encoding::wire_type_mismatch(
tag,
::buffa::encoding::WireType::LengthDelimited,
),
);
}
}
4u32 => {
if tag.wire_type() == ::buffa::encoding::WireType::LengthDelimited {
let len = ::buffa::encoding::decode_varint(buf)?;
let len = usize::try_from(len)
.map_err(|_| ::buffa::DecodeError::MessageTooLarge)?;
if buf.remaining() < len {
return ::core::result::Result::Err(
::buffa::DecodeError::UnexpectedEof,
);
}
if buf.chunk().len() >= len {
::buffa::types::extend_packed_sint32(
&buf.chunk()[..len],
&mut self.uid,
len,
)?;
buf.advance(len);
} else {
self.uid.reserve(len);
let mut limited = buf.take(len);
while limited.has_remaining() {
self.uid
.push(::buffa::types::decode_sint32_packed(&mut limited)?);
}
let leftover = limited.remaining();
if leftover > 0 {
limited.advance(leftover);
}
}
} else if tag.wire_type() == ::buffa::encoding::WireType::Varint {
self.uid.push(::buffa::types::decode_sint32(buf)?);
} else {
return ::core::result::Result::Err(
::buffa::encoding::wire_type_mismatch(
tag,
::buffa::encoding::WireType::LengthDelimited,
),
);
}
}
5u32 => {
if tag.wire_type() == ::buffa::encoding::WireType::LengthDelimited {
let len = ::buffa::encoding::decode_varint(buf)?;
let len = usize::try_from(len)
.map_err(|_| ::buffa::DecodeError::MessageTooLarge)?;
if buf.remaining() < len {
return ::core::result::Result::Err(
::buffa::DecodeError::UnexpectedEof,
);
}
if buf.chunk().len() >= len {
::buffa::types::extend_packed_sint32(
&buf.chunk()[..len],
&mut self.user_sid,
len,
)?;
buf.advance(len);
} else {
self.user_sid.reserve(len);
let mut limited = buf.take(len);
while limited.has_remaining() {
self.user_sid
.push(::buffa::types::decode_sint32_packed(&mut limited)?);
}
let leftover = limited.remaining();
if leftover > 0 {
limited.advance(leftover);
}
}
} else if tag.wire_type() == ::buffa::encoding::WireType::Varint {
self.user_sid.push(::buffa::types::decode_sint32(buf)?);
} else {
return ::core::result::Result::Err(
::buffa::encoding::wire_type_mismatch(
tag,
::buffa::encoding::WireType::LengthDelimited,
),
);
}
}
6u32 => {
if tag.wire_type() == ::buffa::encoding::WireType::LengthDelimited {
let len = ::buffa::encoding::decode_varint(buf)?;
let len = usize::try_from(len)
.map_err(|_| ::buffa::DecodeError::MessageTooLarge)?;
if buf.remaining() < len {
return ::core::result::Result::Err(
::buffa::DecodeError::UnexpectedEof,
);
}
if buf.chunk().len() >= len {
::buffa::types::extend_packed_bool(
&buf.chunk()[..len],
&mut self.visible,
len,
)?;
buf.advance(len);
} else {
self.visible.reserve(len);
let mut limited = buf.take(len);
while limited.has_remaining() {
self.visible
.push(::buffa::types::decode_bool_packed(&mut limited)?);
}
let leftover = limited.remaining();
if leftover > 0 {
limited.advance(leftover);
}
}
} else if tag.wire_type() == ::buffa::encoding::WireType::Varint {
self.visible.push(::buffa::types::decode_bool(buf)?);
} else {
return ::core::result::Result::Err(
::buffa::encoding::wire_type_mismatch(
tag,
::buffa::encoding::WireType::LengthDelimited,
),
);
}
}
_ => {
::buffa::encoding::skip_field_depth(tag, buf, ctx.depth())?;
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.version.clear();
self.timestamp.clear();
self.changeset.clear();
self.uid.clear();
self.user_sid.clear();
self.visible.clear();
}
}
#[derive(Clone, PartialEq, Default)]
pub struct ChangeSet {
pub id: i64,
}
impl ::core::fmt::Debug for ChangeSet {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("ChangeSet").field("id", &self.id).finish()
}
}
impl ChangeSet {
pub const TYPE_URL: &'static str = "type.googleapis.com/OSMPBF.ChangeSet";
}
::buffa::impl_default_instance!(ChangeSet);
impl ::buffa::MessageName for ChangeSet {
const PACKAGE: &'static str = "OSMPBF";
const NAME: &'static str = "ChangeSet";
const FULL_NAME: &'static str = "OSMPBF.ChangeSet";
const TYPE_URL: &'static str = "type.googleapis.com/OSMPBF.ChangeSet";
}
impl ::buffa::Message for ChangeSet {
#[allow(clippy::let_and_return)]
fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
let mut size = 0u64;
size += 1u64 + ::buffa::types::int64_encoded_len(self.id) as u64;
::buffa::saturate_size(size)
}
fn write_to(
&self,
_cache: &mut ::buffa::SizeCache,
buf: &mut impl ::buffa::EncodeSink,
) {
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
::buffa::types::put_int64_field(1u32, self.id, buf);
}
fn merge_field(
&mut self,
tag: ::buffa::encoding::Tag,
buf: &mut impl ::buffa::bytes::Buf,
ctx: ::buffa::DecodeContext<'_>,
) -> ::core::result::Result<(), ::buffa::DecodeError> {
#[allow(unused_imports)]
use ::buffa::bytes::Buf as _;
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
match tag.field_number() {
1u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::Varint,
)?;
self.id = ::buffa::types::decode_int64(buf)?;
}
_ => {
::buffa::encoding::skip_field_depth(tag, buf, ctx.depth())?;
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.id = 0i64;
}
}
#[derive(Clone, PartialEq, Default)]
pub struct Node {
pub id: i64,
pub keys: ::buffa::alloc::vec::Vec<u32>,
pub vals: ::buffa::alloc::vec::Vec<u32>,
pub info: ::buffa::MessageField<Info, ::buffa::Inline<Info>>,
pub lat: i64,
pub lon: i64,
}
impl ::core::fmt::Debug for Node {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("Node")
.field("id", &self.id)
.field("keys", &self.keys)
.field("vals", &self.vals)
.field("info", &self.info)
.field("lat", &self.lat)
.field("lon", &self.lon)
.finish()
}
}
impl Node {
pub const TYPE_URL: &'static str = "type.googleapis.com/OSMPBF.Node";
}
::buffa::impl_default_instance!(Node);
impl ::buffa::MessageName for Node {
const PACKAGE: &'static str = "OSMPBF";
const NAME: &'static str = "Node";
const FULL_NAME: &'static str = "OSMPBF.Node";
const TYPE_URL: &'static str = "type.googleapis.com/OSMPBF.Node";
}
impl ::buffa::Message for Node {
#[allow(clippy::let_and_return)]
fn compute_size(&self, __cache: &mut ::buffa::SizeCache) -> u32 {
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
let mut size = 0u64;
size += 1u64 + ::buffa::types::sint64_encoded_len(self.id) as u64;
if !self.keys.is_empty() {
let payload: u64 = self
.keys
.iter()
.map(|&v| ::buffa::types::uint32_encoded_len(v) as u64)
.sum::<u64>();
size += 1u64 + ::buffa::encoding::varint_len(payload) as u64 + payload;
}
if !self.vals.is_empty() {
let payload: u64 = self
.vals
.iter()
.map(|&v| ::buffa::types::uint32_encoded_len(v) as u64)
.sum::<u64>();
size += 1u64 + ::buffa::encoding::varint_len(payload) as u64 + payload;
}
if self.info.is_set() {
let __slot = __cache.reserve();
let inner_size = self.info.compute_size(__cache);
__cache.set(__slot, inner_size);
size
+= 1u64 + ::buffa::encoding::varint_len(inner_size as u64) as u64
+ inner_size as u64;
}
size += 1u64 + ::buffa::types::sint64_encoded_len(self.lat) as u64;
size += 1u64 + ::buffa::types::sint64_encoded_len(self.lon) as u64;
::buffa::saturate_size(size)
}
fn write_to(
&self,
__cache: &mut ::buffa::SizeCache,
buf: &mut impl ::buffa::EncodeSink,
) {
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
::buffa::types::put_sint64_field(1u32, self.id, buf);
if !self.keys.is_empty() {
let payload: u64 = self
.keys
.iter()
.map(|&v| ::buffa::types::uint32_encoded_len(v) as u64)
.sum::<u64>();
::buffa::types::put_len_delimited_header(2u32, payload, buf);
for &v in &self.keys {
::buffa::types::encode_uint32(v, buf);
}
}
if !self.vals.is_empty() {
let payload: u64 = self
.vals
.iter()
.map(|&v| ::buffa::types::uint32_encoded_len(v) as u64)
.sum::<u64>();
::buffa::types::put_len_delimited_header(3u32, payload, buf);
for &v in &self.vals {
::buffa::types::encode_uint32(v, buf);
}
}
if self.info.is_set() {
::buffa::types::put_len_delimited_header(
4u32,
u64::from(__cache.consume_next()),
buf,
);
self.info.write_to(__cache, buf);
}
::buffa::types::put_sint64_field(8u32, self.lat, buf);
::buffa::types::put_sint64_field(9u32, self.lon, buf);
}
fn merge_field(
&mut self,
tag: ::buffa::encoding::Tag,
buf: &mut impl ::buffa::bytes::Buf,
ctx: ::buffa::DecodeContext<'_>,
) -> ::core::result::Result<(), ::buffa::DecodeError> {
#[allow(unused_imports)]
use ::buffa::bytes::Buf as _;
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
match tag.field_number() {
1u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::Varint,
)?;
self.id = ::buffa::types::decode_sint64(buf)?;
}
2u32 => {
if tag.wire_type() == ::buffa::encoding::WireType::LengthDelimited {
let len = ::buffa::encoding::decode_varint(buf)?;
let len = usize::try_from(len)
.map_err(|_| ::buffa::DecodeError::MessageTooLarge)?;
if buf.remaining() < len {
return ::core::result::Result::Err(
::buffa::DecodeError::UnexpectedEof,
);
}
if buf.chunk().len() >= len {
::buffa::types::extend_packed_uint32(
&buf.chunk()[..len],
&mut self.keys,
len,
)?;
buf.advance(len);
} else {
self.keys.reserve(len);
let mut limited = buf.take(len);
while limited.has_remaining() {
self.keys
.push(::buffa::types::decode_uint32_packed(&mut limited)?);
}
let leftover = limited.remaining();
if leftover > 0 {
limited.advance(leftover);
}
}
} else if tag.wire_type() == ::buffa::encoding::WireType::Varint {
self.keys.push(::buffa::types::decode_uint32(buf)?);
} else {
return ::core::result::Result::Err(
::buffa::encoding::wire_type_mismatch(
tag,
::buffa::encoding::WireType::LengthDelimited,
),
);
}
}
3u32 => {
if tag.wire_type() == ::buffa::encoding::WireType::LengthDelimited {
let len = ::buffa::encoding::decode_varint(buf)?;
let len = usize::try_from(len)
.map_err(|_| ::buffa::DecodeError::MessageTooLarge)?;
if buf.remaining() < len {
return ::core::result::Result::Err(
::buffa::DecodeError::UnexpectedEof,
);
}
if buf.chunk().len() >= len {
::buffa::types::extend_packed_uint32(
&buf.chunk()[..len],
&mut self.vals,
len,
)?;
buf.advance(len);
} else {
self.vals.reserve(len);
let mut limited = buf.take(len);
while limited.has_remaining() {
self.vals
.push(::buffa::types::decode_uint32_packed(&mut limited)?);
}
let leftover = limited.remaining();
if leftover > 0 {
limited.advance(leftover);
}
}
} else if tag.wire_type() == ::buffa::encoding::WireType::Varint {
self.vals.push(::buffa::types::decode_uint32(buf)?);
} else {
return ::core::result::Result::Err(
::buffa::encoding::wire_type_mismatch(
tag,
::buffa::encoding::WireType::LengthDelimited,
),
);
}
}
4u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::LengthDelimited,
)?;
::buffa::Message::merge_length_delimited(
self.info.get_or_insert_default(),
buf,
ctx,
)?;
}
8u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::Varint,
)?;
self.lat = ::buffa::types::decode_sint64(buf)?;
}
9u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::Varint,
)?;
self.lon = ::buffa::types::decode_sint64(buf)?;
}
_ => {
::buffa::encoding::skip_field_depth(tag, buf, ctx.depth())?;
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.id = 0i64;
self.keys.clear();
self.vals.clear();
self.info = ::buffa::MessageField::none();
self.lat = 0i64;
self.lon = 0i64;
}
}
#[derive(Clone, PartialEq, Default)]
pub struct DenseNodes {
pub id: ::buffa::alloc::vec::Vec<i64>,
pub denseinfo: ::buffa::MessageField<DenseInfo, ::buffa::Inline<DenseInfo>>,
pub lat: ::buffa::alloc::vec::Vec<i64>,
pub lon: ::buffa::alloc::vec::Vec<i64>,
pub keys_vals: ::buffa::alloc::vec::Vec<i32>,
}
impl ::core::fmt::Debug for DenseNodes {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("DenseNodes")
.field("id", &self.id)
.field("denseinfo", &self.denseinfo)
.field("lat", &self.lat)
.field("lon", &self.lon)
.field("keys_vals", &self.keys_vals)
.finish()
}
}
impl DenseNodes {
pub const TYPE_URL: &'static str = "type.googleapis.com/OSMPBF.DenseNodes";
}
::buffa::impl_default_instance!(DenseNodes);
impl ::buffa::MessageName for DenseNodes {
const PACKAGE: &'static str = "OSMPBF";
const NAME: &'static str = "DenseNodes";
const FULL_NAME: &'static str = "OSMPBF.DenseNodes";
const TYPE_URL: &'static str = "type.googleapis.com/OSMPBF.DenseNodes";
}
impl ::buffa::Message for DenseNodes {
#[allow(clippy::let_and_return)]
fn compute_size(&self, __cache: &mut ::buffa::SizeCache) -> u32 {
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
let mut size = 0u64;
if !self.id.is_empty() {
let payload: u64 = self
.id
.iter()
.map(|&v| ::buffa::types::sint64_encoded_len(v) as u64)
.sum::<u64>();
size += 1u64 + ::buffa::encoding::varint_len(payload) as u64 + payload;
}
if self.denseinfo.is_set() {
let __slot = __cache.reserve();
let inner_size = self.denseinfo.compute_size(__cache);
__cache.set(__slot, inner_size);
size
+= 1u64 + ::buffa::encoding::varint_len(inner_size as u64) as u64
+ inner_size as u64;
}
if !self.lat.is_empty() {
let payload: u64 = self
.lat
.iter()
.map(|&v| ::buffa::types::sint64_encoded_len(v) as u64)
.sum::<u64>();
size += 1u64 + ::buffa::encoding::varint_len(payload) as u64 + payload;
}
if !self.lon.is_empty() {
let payload: u64 = self
.lon
.iter()
.map(|&v| ::buffa::types::sint64_encoded_len(v) as u64)
.sum::<u64>();
size += 1u64 + ::buffa::encoding::varint_len(payload) as u64 + payload;
}
if !self.keys_vals.is_empty() {
let payload: u64 = self
.keys_vals
.iter()
.map(|&v| ::buffa::types::int32_encoded_len(v) as u64)
.sum::<u64>();
size += 1u64 + ::buffa::encoding::varint_len(payload) as u64 + payload;
}
::buffa::saturate_size(size)
}
fn write_to(
&self,
__cache: &mut ::buffa::SizeCache,
buf: &mut impl ::buffa::EncodeSink,
) {
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
if !self.id.is_empty() {
let payload: u64 = self
.id
.iter()
.map(|&v| ::buffa::types::sint64_encoded_len(v) as u64)
.sum::<u64>();
::buffa::types::put_len_delimited_header(1u32, payload, buf);
for &v in &self.id {
::buffa::types::encode_sint64(v, buf);
}
}
if self.denseinfo.is_set() {
::buffa::types::put_len_delimited_header(
5u32,
u64::from(__cache.consume_next()),
buf,
);
self.denseinfo.write_to(__cache, buf);
}
if !self.lat.is_empty() {
let payload: u64 = self
.lat
.iter()
.map(|&v| ::buffa::types::sint64_encoded_len(v) as u64)
.sum::<u64>();
::buffa::types::put_len_delimited_header(8u32, payload, buf);
for &v in &self.lat {
::buffa::types::encode_sint64(v, buf);
}
}
if !self.lon.is_empty() {
let payload: u64 = self
.lon
.iter()
.map(|&v| ::buffa::types::sint64_encoded_len(v) as u64)
.sum::<u64>();
::buffa::types::put_len_delimited_header(9u32, payload, buf);
for &v in &self.lon {
::buffa::types::encode_sint64(v, buf);
}
}
if !self.keys_vals.is_empty() {
let payload: u64 = self
.keys_vals
.iter()
.map(|&v| ::buffa::types::int32_encoded_len(v) as u64)
.sum::<u64>();
::buffa::types::put_len_delimited_header(10u32, payload, buf);
for &v in &self.keys_vals {
::buffa::types::encode_int32(v, buf);
}
}
}
fn merge_field(
&mut self,
tag: ::buffa::encoding::Tag,
buf: &mut impl ::buffa::bytes::Buf,
ctx: ::buffa::DecodeContext<'_>,
) -> ::core::result::Result<(), ::buffa::DecodeError> {
#[allow(unused_imports)]
use ::buffa::bytes::Buf as _;
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
match tag.field_number() {
1u32 => {
if tag.wire_type() == ::buffa::encoding::WireType::LengthDelimited {
let len = ::buffa::encoding::decode_varint(buf)?;
let len = usize::try_from(len)
.map_err(|_| ::buffa::DecodeError::MessageTooLarge)?;
if buf.remaining() < len {
return ::core::result::Result::Err(
::buffa::DecodeError::UnexpectedEof,
);
}
if buf.chunk().len() >= len {
::buffa::types::extend_packed_sint64(
&buf.chunk()[..len],
&mut self.id,
len,
)?;
buf.advance(len);
} else {
self.id.reserve(len);
let mut limited = buf.take(len);
while limited.has_remaining() {
self.id
.push(::buffa::types::decode_sint64_packed(&mut limited)?);
}
let leftover = limited.remaining();
if leftover > 0 {
limited.advance(leftover);
}
}
} else if tag.wire_type() == ::buffa::encoding::WireType::Varint {
self.id.push(::buffa::types::decode_sint64(buf)?);
} else {
return ::core::result::Result::Err(
::buffa::encoding::wire_type_mismatch(
tag,
::buffa::encoding::WireType::LengthDelimited,
),
);
}
}
5u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::LengthDelimited,
)?;
::buffa::Message::merge_length_delimited(
self.denseinfo.get_or_insert_default(),
buf,
ctx,
)?;
}
8u32 => {
if tag.wire_type() == ::buffa::encoding::WireType::LengthDelimited {
let len = ::buffa::encoding::decode_varint(buf)?;
let len = usize::try_from(len)
.map_err(|_| ::buffa::DecodeError::MessageTooLarge)?;
if buf.remaining() < len {
return ::core::result::Result::Err(
::buffa::DecodeError::UnexpectedEof,
);
}
if buf.chunk().len() >= len {
::buffa::types::extend_packed_sint64(
&buf.chunk()[..len],
&mut self.lat,
len,
)?;
buf.advance(len);
} else {
self.lat.reserve(len);
let mut limited = buf.take(len);
while limited.has_remaining() {
self.lat
.push(::buffa::types::decode_sint64_packed(&mut limited)?);
}
let leftover = limited.remaining();
if leftover > 0 {
limited.advance(leftover);
}
}
} else if tag.wire_type() == ::buffa::encoding::WireType::Varint {
self.lat.push(::buffa::types::decode_sint64(buf)?);
} else {
return ::core::result::Result::Err(
::buffa::encoding::wire_type_mismatch(
tag,
::buffa::encoding::WireType::LengthDelimited,
),
);
}
}
9u32 => {
if tag.wire_type() == ::buffa::encoding::WireType::LengthDelimited {
let len = ::buffa::encoding::decode_varint(buf)?;
let len = usize::try_from(len)
.map_err(|_| ::buffa::DecodeError::MessageTooLarge)?;
if buf.remaining() < len {
return ::core::result::Result::Err(
::buffa::DecodeError::UnexpectedEof,
);
}
if buf.chunk().len() >= len {
::buffa::types::extend_packed_sint64(
&buf.chunk()[..len],
&mut self.lon,
len,
)?;
buf.advance(len);
} else {
self.lon.reserve(len);
let mut limited = buf.take(len);
while limited.has_remaining() {
self.lon
.push(::buffa::types::decode_sint64_packed(&mut limited)?);
}
let leftover = limited.remaining();
if leftover > 0 {
limited.advance(leftover);
}
}
} else if tag.wire_type() == ::buffa::encoding::WireType::Varint {
self.lon.push(::buffa::types::decode_sint64(buf)?);
} else {
return ::core::result::Result::Err(
::buffa::encoding::wire_type_mismatch(
tag,
::buffa::encoding::WireType::LengthDelimited,
),
);
}
}
10u32 => {
if tag.wire_type() == ::buffa::encoding::WireType::LengthDelimited {
let len = ::buffa::encoding::decode_varint(buf)?;
let len = usize::try_from(len)
.map_err(|_| ::buffa::DecodeError::MessageTooLarge)?;
if buf.remaining() < len {
return ::core::result::Result::Err(
::buffa::DecodeError::UnexpectedEof,
);
}
if buf.chunk().len() >= len {
::buffa::types::extend_packed_int32(
&buf.chunk()[..len],
&mut self.keys_vals,
len,
)?;
buf.advance(len);
} else {
self.keys_vals.reserve(len);
let mut limited = buf.take(len);
while limited.has_remaining() {
self.keys_vals
.push(::buffa::types::decode_int32_packed(&mut limited)?);
}
let leftover = limited.remaining();
if leftover > 0 {
limited.advance(leftover);
}
}
} else if tag.wire_type() == ::buffa::encoding::WireType::Varint {
self.keys_vals.push(::buffa::types::decode_int32(buf)?);
} else {
return ::core::result::Result::Err(
::buffa::encoding::wire_type_mismatch(
tag,
::buffa::encoding::WireType::LengthDelimited,
),
);
}
}
_ => {
::buffa::encoding::skip_field_depth(tag, buf, ctx.depth())?;
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.id.clear();
self.denseinfo = ::buffa::MessageField::none();
self.lat.clear();
self.lon.clear();
self.keys_vals.clear();
}
}
#[derive(Clone, PartialEq, Default)]
pub struct Way {
pub id: i64,
pub keys: ::buffa::alloc::vec::Vec<u32>,
pub vals: ::buffa::alloc::vec::Vec<u32>,
pub info: ::buffa::MessageField<Info, ::buffa::Inline<Info>>,
pub refs: ::buffa::alloc::vec::Vec<i64>,
pub lat: ::buffa::alloc::vec::Vec<i64>,
pub lon: ::buffa::alloc::vec::Vec<i64>,
}
impl ::core::fmt::Debug for Way {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("Way")
.field("id", &self.id)
.field("keys", &self.keys)
.field("vals", &self.vals)
.field("info", &self.info)
.field("refs", &self.refs)
.field("lat", &self.lat)
.field("lon", &self.lon)
.finish()
}
}
impl Way {
pub const TYPE_URL: &'static str = "type.googleapis.com/OSMPBF.Way";
}
::buffa::impl_default_instance!(Way);
impl ::buffa::MessageName for Way {
const PACKAGE: &'static str = "OSMPBF";
const NAME: &'static str = "Way";
const FULL_NAME: &'static str = "OSMPBF.Way";
const TYPE_URL: &'static str = "type.googleapis.com/OSMPBF.Way";
}
impl ::buffa::Message for Way {
#[allow(clippy::let_and_return)]
fn compute_size(&self, __cache: &mut ::buffa::SizeCache) -> u32 {
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
let mut size = 0u64;
size += 1u64 + ::buffa::types::int64_encoded_len(self.id) as u64;
if !self.keys.is_empty() {
let payload: u64 = self
.keys
.iter()
.map(|&v| ::buffa::types::uint32_encoded_len(v) as u64)
.sum::<u64>();
size += 1u64 + ::buffa::encoding::varint_len(payload) as u64 + payload;
}
if !self.vals.is_empty() {
let payload: u64 = self
.vals
.iter()
.map(|&v| ::buffa::types::uint32_encoded_len(v) as u64)
.sum::<u64>();
size += 1u64 + ::buffa::encoding::varint_len(payload) as u64 + payload;
}
if self.info.is_set() {
let __slot = __cache.reserve();
let inner_size = self.info.compute_size(__cache);
__cache.set(__slot, inner_size);
size
+= 1u64 + ::buffa::encoding::varint_len(inner_size as u64) as u64
+ inner_size as u64;
}
if !self.refs.is_empty() {
let payload: u64 = self
.refs
.iter()
.map(|&v| ::buffa::types::sint64_encoded_len(v) as u64)
.sum::<u64>();
size += 1u64 + ::buffa::encoding::varint_len(payload) as u64 + payload;
}
if !self.lat.is_empty() {
let payload: u64 = self
.lat
.iter()
.map(|&v| ::buffa::types::sint64_encoded_len(v) as u64)
.sum::<u64>();
size += 1u64 + ::buffa::encoding::varint_len(payload) as u64 + payload;
}
if !self.lon.is_empty() {
let payload: u64 = self
.lon
.iter()
.map(|&v| ::buffa::types::sint64_encoded_len(v) as u64)
.sum::<u64>();
size += 1u64 + ::buffa::encoding::varint_len(payload) as u64 + payload;
}
::buffa::saturate_size(size)
}
fn write_to(
&self,
__cache: &mut ::buffa::SizeCache,
buf: &mut impl ::buffa::EncodeSink,
) {
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
::buffa::types::put_int64_field(1u32, self.id, buf);
if !self.keys.is_empty() {
let payload: u64 = self
.keys
.iter()
.map(|&v| ::buffa::types::uint32_encoded_len(v) as u64)
.sum::<u64>();
::buffa::types::put_len_delimited_header(2u32, payload, buf);
for &v in &self.keys {
::buffa::types::encode_uint32(v, buf);
}
}
if !self.vals.is_empty() {
let payload: u64 = self
.vals
.iter()
.map(|&v| ::buffa::types::uint32_encoded_len(v) as u64)
.sum::<u64>();
::buffa::types::put_len_delimited_header(3u32, payload, buf);
for &v in &self.vals {
::buffa::types::encode_uint32(v, buf);
}
}
if self.info.is_set() {
::buffa::types::put_len_delimited_header(
4u32,
u64::from(__cache.consume_next()),
buf,
);
self.info.write_to(__cache, buf);
}
if !self.refs.is_empty() {
let payload: u64 = self
.refs
.iter()
.map(|&v| ::buffa::types::sint64_encoded_len(v) as u64)
.sum::<u64>();
::buffa::types::put_len_delimited_header(8u32, payload, buf);
for &v in &self.refs {
::buffa::types::encode_sint64(v, buf);
}
}
if !self.lat.is_empty() {
let payload: u64 = self
.lat
.iter()
.map(|&v| ::buffa::types::sint64_encoded_len(v) as u64)
.sum::<u64>();
::buffa::types::put_len_delimited_header(9u32, payload, buf);
for &v in &self.lat {
::buffa::types::encode_sint64(v, buf);
}
}
if !self.lon.is_empty() {
let payload: u64 = self
.lon
.iter()
.map(|&v| ::buffa::types::sint64_encoded_len(v) as u64)
.sum::<u64>();
::buffa::types::put_len_delimited_header(10u32, payload, buf);
for &v in &self.lon {
::buffa::types::encode_sint64(v, buf);
}
}
}
fn merge_field(
&mut self,
tag: ::buffa::encoding::Tag,
buf: &mut impl ::buffa::bytes::Buf,
ctx: ::buffa::DecodeContext<'_>,
) -> ::core::result::Result<(), ::buffa::DecodeError> {
#[allow(unused_imports)]
use ::buffa::bytes::Buf as _;
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
match tag.field_number() {
1u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::Varint,
)?;
self.id = ::buffa::types::decode_int64(buf)?;
}
2u32 => {
if tag.wire_type() == ::buffa::encoding::WireType::LengthDelimited {
let len = ::buffa::encoding::decode_varint(buf)?;
let len = usize::try_from(len)
.map_err(|_| ::buffa::DecodeError::MessageTooLarge)?;
if buf.remaining() < len {
return ::core::result::Result::Err(
::buffa::DecodeError::UnexpectedEof,
);
}
if buf.chunk().len() >= len {
::buffa::types::extend_packed_uint32(
&buf.chunk()[..len],
&mut self.keys,
len,
)?;
buf.advance(len);
} else {
self.keys.reserve(len);
let mut limited = buf.take(len);
while limited.has_remaining() {
self.keys
.push(::buffa::types::decode_uint32_packed(&mut limited)?);
}
let leftover = limited.remaining();
if leftover > 0 {
limited.advance(leftover);
}
}
} else if tag.wire_type() == ::buffa::encoding::WireType::Varint {
self.keys.push(::buffa::types::decode_uint32(buf)?);
} else {
return ::core::result::Result::Err(
::buffa::encoding::wire_type_mismatch(
tag,
::buffa::encoding::WireType::LengthDelimited,
),
);
}
}
3u32 => {
if tag.wire_type() == ::buffa::encoding::WireType::LengthDelimited {
let len = ::buffa::encoding::decode_varint(buf)?;
let len = usize::try_from(len)
.map_err(|_| ::buffa::DecodeError::MessageTooLarge)?;
if buf.remaining() < len {
return ::core::result::Result::Err(
::buffa::DecodeError::UnexpectedEof,
);
}
if buf.chunk().len() >= len {
::buffa::types::extend_packed_uint32(
&buf.chunk()[..len],
&mut self.vals,
len,
)?;
buf.advance(len);
} else {
self.vals.reserve(len);
let mut limited = buf.take(len);
while limited.has_remaining() {
self.vals
.push(::buffa::types::decode_uint32_packed(&mut limited)?);
}
let leftover = limited.remaining();
if leftover > 0 {
limited.advance(leftover);
}
}
} else if tag.wire_type() == ::buffa::encoding::WireType::Varint {
self.vals.push(::buffa::types::decode_uint32(buf)?);
} else {
return ::core::result::Result::Err(
::buffa::encoding::wire_type_mismatch(
tag,
::buffa::encoding::WireType::LengthDelimited,
),
);
}
}
4u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::LengthDelimited,
)?;
::buffa::Message::merge_length_delimited(
self.info.get_or_insert_default(),
buf,
ctx,
)?;
}
8u32 => {
if tag.wire_type() == ::buffa::encoding::WireType::LengthDelimited {
let len = ::buffa::encoding::decode_varint(buf)?;
let len = usize::try_from(len)
.map_err(|_| ::buffa::DecodeError::MessageTooLarge)?;
if buf.remaining() < len {
return ::core::result::Result::Err(
::buffa::DecodeError::UnexpectedEof,
);
}
if buf.chunk().len() >= len {
::buffa::types::extend_packed_sint64(
&buf.chunk()[..len],
&mut self.refs,
len,
)?;
buf.advance(len);
} else {
self.refs.reserve(len);
let mut limited = buf.take(len);
while limited.has_remaining() {
self.refs
.push(::buffa::types::decode_sint64_packed(&mut limited)?);
}
let leftover = limited.remaining();
if leftover > 0 {
limited.advance(leftover);
}
}
} else if tag.wire_type() == ::buffa::encoding::WireType::Varint {
self.refs.push(::buffa::types::decode_sint64(buf)?);
} else {
return ::core::result::Result::Err(
::buffa::encoding::wire_type_mismatch(
tag,
::buffa::encoding::WireType::LengthDelimited,
),
);
}
}
9u32 => {
if tag.wire_type() == ::buffa::encoding::WireType::LengthDelimited {
let len = ::buffa::encoding::decode_varint(buf)?;
let len = usize::try_from(len)
.map_err(|_| ::buffa::DecodeError::MessageTooLarge)?;
if buf.remaining() < len {
return ::core::result::Result::Err(
::buffa::DecodeError::UnexpectedEof,
);
}
if buf.chunk().len() >= len {
::buffa::types::extend_packed_sint64(
&buf.chunk()[..len],
&mut self.lat,
len,
)?;
buf.advance(len);
} else {
self.lat.reserve(len);
let mut limited = buf.take(len);
while limited.has_remaining() {
self.lat
.push(::buffa::types::decode_sint64_packed(&mut limited)?);
}
let leftover = limited.remaining();
if leftover > 0 {
limited.advance(leftover);
}
}
} else if tag.wire_type() == ::buffa::encoding::WireType::Varint {
self.lat.push(::buffa::types::decode_sint64(buf)?);
} else {
return ::core::result::Result::Err(
::buffa::encoding::wire_type_mismatch(
tag,
::buffa::encoding::WireType::LengthDelimited,
),
);
}
}
10u32 => {
if tag.wire_type() == ::buffa::encoding::WireType::LengthDelimited {
let len = ::buffa::encoding::decode_varint(buf)?;
let len = usize::try_from(len)
.map_err(|_| ::buffa::DecodeError::MessageTooLarge)?;
if buf.remaining() < len {
return ::core::result::Result::Err(
::buffa::DecodeError::UnexpectedEof,
);
}
if buf.chunk().len() >= len {
::buffa::types::extend_packed_sint64(
&buf.chunk()[..len],
&mut self.lon,
len,
)?;
buf.advance(len);
} else {
self.lon.reserve(len);
let mut limited = buf.take(len);
while limited.has_remaining() {
self.lon
.push(::buffa::types::decode_sint64_packed(&mut limited)?);
}
let leftover = limited.remaining();
if leftover > 0 {
limited.advance(leftover);
}
}
} else if tag.wire_type() == ::buffa::encoding::WireType::Varint {
self.lon.push(::buffa::types::decode_sint64(buf)?);
} else {
return ::core::result::Result::Err(
::buffa::encoding::wire_type_mismatch(
tag,
::buffa::encoding::WireType::LengthDelimited,
),
);
}
}
_ => {
::buffa::encoding::skip_field_depth(tag, buf, ctx.depth())?;
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.id = 0i64;
self.keys.clear();
self.vals.clear();
self.info = ::buffa::MessageField::none();
self.refs.clear();
self.lat.clear();
self.lon.clear();
}
}
#[derive(Clone, PartialEq, Default)]
pub struct Relation {
pub id: i64,
pub keys: ::buffa::alloc::vec::Vec<u32>,
pub vals: ::buffa::alloc::vec::Vec<u32>,
pub info: ::buffa::MessageField<Info, ::buffa::Inline<Info>>,
pub roles_sid: ::buffa::alloc::vec::Vec<i32>,
pub memids: ::buffa::alloc::vec::Vec<i64>,
pub types: ::buffa::alloc::vec::Vec<relation::MemberType>,
}
impl ::core::fmt::Debug for Relation {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("Relation")
.field("id", &self.id)
.field("keys", &self.keys)
.field("vals", &self.vals)
.field("info", &self.info)
.field("roles_sid", &self.roles_sid)
.field("memids", &self.memids)
.field("types", &self.types)
.finish()
}
}
impl Relation {
pub const TYPE_URL: &'static str = "type.googleapis.com/OSMPBF.Relation";
}
::buffa::impl_default_instance!(Relation);
impl ::buffa::MessageName for Relation {
const PACKAGE: &'static str = "OSMPBF";
const NAME: &'static str = "Relation";
const FULL_NAME: &'static str = "OSMPBF.Relation";
const TYPE_URL: &'static str = "type.googleapis.com/OSMPBF.Relation";
}
impl ::buffa::Message for Relation {
#[allow(clippy::let_and_return)]
fn compute_size(&self, __cache: &mut ::buffa::SizeCache) -> u32 {
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
let mut size = 0u64;
size += 1u64 + ::buffa::types::int64_encoded_len(self.id) as u64;
if !self.keys.is_empty() {
let payload: u64 = self
.keys
.iter()
.map(|&v| ::buffa::types::uint32_encoded_len(v) as u64)
.sum::<u64>();
size += 1u64 + ::buffa::encoding::varint_len(payload) as u64 + payload;
}
if !self.vals.is_empty() {
let payload: u64 = self
.vals
.iter()
.map(|&v| ::buffa::types::uint32_encoded_len(v) as u64)
.sum::<u64>();
size += 1u64 + ::buffa::encoding::varint_len(payload) as u64 + payload;
}
if self.info.is_set() {
let __slot = __cache.reserve();
let inner_size = self.info.compute_size(__cache);
__cache.set(__slot, inner_size);
size
+= 1u64 + ::buffa::encoding::varint_len(inner_size as u64) as u64
+ inner_size as u64;
}
if !self.roles_sid.is_empty() {
let payload: u64 = self
.roles_sid
.iter()
.map(|&v| ::buffa::types::int32_encoded_len(v) as u64)
.sum::<u64>();
size += 1u64 + ::buffa::encoding::varint_len(payload) as u64 + payload;
}
if !self.memids.is_empty() {
let payload: u64 = self
.memids
.iter()
.map(|&v| ::buffa::types::sint64_encoded_len(v) as u64)
.sum::<u64>();
size += 1u64 + ::buffa::encoding::varint_len(payload) as u64 + payload;
}
if !self.types.is_empty() {
let payload: u64 = self
.types
.iter()
.map(|v| ::buffa::types::int32_encoded_len(v.to_i32()) as u64)
.sum::<u64>();
size += 1u64 + ::buffa::encoding::varint_len(payload) as u64 + payload;
}
::buffa::saturate_size(size)
}
fn write_to(
&self,
__cache: &mut ::buffa::SizeCache,
buf: &mut impl ::buffa::EncodeSink,
) {
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
::buffa::types::put_int64_field(1u32, self.id, buf);
if !self.keys.is_empty() {
let payload: u64 = self
.keys
.iter()
.map(|&v| ::buffa::types::uint32_encoded_len(v) as u64)
.sum::<u64>();
::buffa::types::put_len_delimited_header(2u32, payload, buf);
for &v in &self.keys {
::buffa::types::encode_uint32(v, buf);
}
}
if !self.vals.is_empty() {
let payload: u64 = self
.vals
.iter()
.map(|&v| ::buffa::types::uint32_encoded_len(v) as u64)
.sum::<u64>();
::buffa::types::put_len_delimited_header(3u32, payload, buf);
for &v in &self.vals {
::buffa::types::encode_uint32(v, buf);
}
}
if self.info.is_set() {
::buffa::types::put_len_delimited_header(
4u32,
u64::from(__cache.consume_next()),
buf,
);
self.info.write_to(__cache, buf);
}
if !self.roles_sid.is_empty() {
let payload: u64 = self
.roles_sid
.iter()
.map(|&v| ::buffa::types::int32_encoded_len(v) as u64)
.sum::<u64>();
::buffa::types::put_len_delimited_header(8u32, payload, buf);
for &v in &self.roles_sid {
::buffa::types::encode_int32(v, buf);
}
}
if !self.memids.is_empty() {
let payload: u64 = self
.memids
.iter()
.map(|&v| ::buffa::types::sint64_encoded_len(v) as u64)
.sum::<u64>();
::buffa::types::put_len_delimited_header(9u32, payload, buf);
for &v in &self.memids {
::buffa::types::encode_sint64(v, buf);
}
}
if !self.types.is_empty() {
let payload: u64 = self
.types
.iter()
.map(|v| ::buffa::types::int32_encoded_len(v.to_i32()) as u64)
.sum::<u64>();
::buffa::types::put_len_delimited_header(10u32, payload, buf);
for v in &self.types {
::buffa::types::encode_int32(v.to_i32(), buf);
}
}
}
fn merge_field(
&mut self,
tag: ::buffa::encoding::Tag,
buf: &mut impl ::buffa::bytes::Buf,
ctx: ::buffa::DecodeContext<'_>,
) -> ::core::result::Result<(), ::buffa::DecodeError> {
#[allow(unused_imports)]
use ::buffa::bytes::Buf as _;
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
match tag.field_number() {
1u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::Varint,
)?;
self.id = ::buffa::types::decode_int64(buf)?;
}
2u32 => {
if tag.wire_type() == ::buffa::encoding::WireType::LengthDelimited {
let len = ::buffa::encoding::decode_varint(buf)?;
let len = usize::try_from(len)
.map_err(|_| ::buffa::DecodeError::MessageTooLarge)?;
if buf.remaining() < len {
return ::core::result::Result::Err(
::buffa::DecodeError::UnexpectedEof,
);
}
if buf.chunk().len() >= len {
::buffa::types::extend_packed_uint32(
&buf.chunk()[..len],
&mut self.keys,
len,
)?;
buf.advance(len);
} else {
self.keys.reserve(len);
let mut limited = buf.take(len);
while limited.has_remaining() {
self.keys
.push(::buffa::types::decode_uint32_packed(&mut limited)?);
}
let leftover = limited.remaining();
if leftover > 0 {
limited.advance(leftover);
}
}
} else if tag.wire_type() == ::buffa::encoding::WireType::Varint {
self.keys.push(::buffa::types::decode_uint32(buf)?);
} else {
return ::core::result::Result::Err(
::buffa::encoding::wire_type_mismatch(
tag,
::buffa::encoding::WireType::LengthDelimited,
),
);
}
}
3u32 => {
if tag.wire_type() == ::buffa::encoding::WireType::LengthDelimited {
let len = ::buffa::encoding::decode_varint(buf)?;
let len = usize::try_from(len)
.map_err(|_| ::buffa::DecodeError::MessageTooLarge)?;
if buf.remaining() < len {
return ::core::result::Result::Err(
::buffa::DecodeError::UnexpectedEof,
);
}
if buf.chunk().len() >= len {
::buffa::types::extend_packed_uint32(
&buf.chunk()[..len],
&mut self.vals,
len,
)?;
buf.advance(len);
} else {
self.vals.reserve(len);
let mut limited = buf.take(len);
while limited.has_remaining() {
self.vals
.push(::buffa::types::decode_uint32_packed(&mut limited)?);
}
let leftover = limited.remaining();
if leftover > 0 {
limited.advance(leftover);
}
}
} else if tag.wire_type() == ::buffa::encoding::WireType::Varint {
self.vals.push(::buffa::types::decode_uint32(buf)?);
} else {
return ::core::result::Result::Err(
::buffa::encoding::wire_type_mismatch(
tag,
::buffa::encoding::WireType::LengthDelimited,
),
);
}
}
4u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::LengthDelimited,
)?;
::buffa::Message::merge_length_delimited(
self.info.get_or_insert_default(),
buf,
ctx,
)?;
}
8u32 => {
if tag.wire_type() == ::buffa::encoding::WireType::LengthDelimited {
let len = ::buffa::encoding::decode_varint(buf)?;
let len = usize::try_from(len)
.map_err(|_| ::buffa::DecodeError::MessageTooLarge)?;
if buf.remaining() < len {
return ::core::result::Result::Err(
::buffa::DecodeError::UnexpectedEof,
);
}
if buf.chunk().len() >= len {
::buffa::types::extend_packed_int32(
&buf.chunk()[..len],
&mut self.roles_sid,
len,
)?;
buf.advance(len);
} else {
self.roles_sid.reserve(len);
let mut limited = buf.take(len);
while limited.has_remaining() {
self.roles_sid
.push(::buffa::types::decode_int32_packed(&mut limited)?);
}
let leftover = limited.remaining();
if leftover > 0 {
limited.advance(leftover);
}
}
} else if tag.wire_type() == ::buffa::encoding::WireType::Varint {
self.roles_sid.push(::buffa::types::decode_int32(buf)?);
} else {
return ::core::result::Result::Err(
::buffa::encoding::wire_type_mismatch(
tag,
::buffa::encoding::WireType::LengthDelimited,
),
);
}
}
9u32 => {
if tag.wire_type() == ::buffa::encoding::WireType::LengthDelimited {
let len = ::buffa::encoding::decode_varint(buf)?;
let len = usize::try_from(len)
.map_err(|_| ::buffa::DecodeError::MessageTooLarge)?;
if buf.remaining() < len {
return ::core::result::Result::Err(
::buffa::DecodeError::UnexpectedEof,
);
}
if buf.chunk().len() >= len {
::buffa::types::extend_packed_sint64(
&buf.chunk()[..len],
&mut self.memids,
len,
)?;
buf.advance(len);
} else {
self.memids.reserve(len);
let mut limited = buf.take(len);
while limited.has_remaining() {
self.memids
.push(::buffa::types::decode_sint64_packed(&mut limited)?);
}
let leftover = limited.remaining();
if leftover > 0 {
limited.advance(leftover);
}
}
} else if tag.wire_type() == ::buffa::encoding::WireType::Varint {
self.memids.push(::buffa::types::decode_sint64(buf)?);
} else {
return ::core::result::Result::Err(
::buffa::encoding::wire_type_mismatch(
tag,
::buffa::encoding::WireType::LengthDelimited,
),
);
}
}
10u32 => {
if tag.wire_type() == ::buffa::encoding::WireType::LengthDelimited {
let len = ::buffa::encoding::decode_varint(buf)?;
let len = usize::try_from(len)
.map_err(|_| ::buffa::DecodeError::MessageTooLarge)?;
if buf.remaining() < len {
return ::core::result::Result::Err(
::buffa::DecodeError::UnexpectedEof,
);
}
self.types.reserve(len);
let mut limited = buf.take(len);
while limited.has_remaining() {
let __raw = ::buffa::types::decode_int32(&mut limited)?;
if let ::core::option::Option::Some(__v) = ::buffa::Enumeration::from_i32(
__raw,
) {
self.types.push(__v);
}
}
let leftover = limited.remaining();
if leftover > 0 {
limited.advance(leftover);
}
} else if tag.wire_type() == ::buffa::encoding::WireType::Varint {
let __raw = ::buffa::types::decode_int32(buf)?;
if let ::core::option::Option::Some(__v) = ::buffa::Enumeration::from_i32(
__raw,
) {
self.types.push(__v);
}
} else {
return ::core::result::Result::Err(
::buffa::encoding::wire_type_mismatch(
tag,
::buffa::encoding::WireType::LengthDelimited,
),
);
}
}
_ => {
::buffa::encoding::skip_field_depth(tag, buf, ctx.depth())?;
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.id = 0i64;
self.keys.clear();
self.vals.clear();
self.info = ::buffa::MessageField::none();
self.roles_sid.clear();
self.memids.clear();
self.types.clear();
}
}
pub mod relation {
#[allow(unused_imports)]
use super::*;
#[allow(non_camel_case_types)]
#[derive(Clone, Copy, PartialEq, Eq, Hash, Debug)]
#[repr(i32)]
pub enum MemberType {
NODE = 0i32,
WAY = 1i32,
RELATION = 2i32,
}
impl MemberType {
#[allow(non_upper_case_globals)]
pub const Node: Self = Self::NODE;
#[allow(non_upper_case_globals)]
pub const Way: Self = Self::WAY;
#[allow(non_upper_case_globals)]
pub const Relation: Self = Self::RELATION;
}
impl ::core::default::Default for MemberType {
fn default() -> Self {
Self::NODE
}
}
impl ::buffa::Enumeration for MemberType {
fn from_i32(value: i32) -> ::core::option::Option<Self> {
match value {
0i32 => ::core::option::Option::Some(Self::NODE),
1i32 => ::core::option::Option::Some(Self::WAY),
2i32 => ::core::option::Option::Some(Self::RELATION),
_ => ::core::option::Option::None,
}
}
fn to_i32(&self) -> i32 {
*self as i32
}
fn proto_name(&self) -> &'static str {
match self {
Self::NODE => "NODE",
Self::WAY => "WAY",
Self::RELATION => "RELATION",
}
}
fn from_proto_name(name: &str) -> ::core::option::Option<Self> {
match name {
"NODE" => ::core::option::Option::Some(Self::NODE),
"WAY" => ::core::option::Option::Some(Self::WAY),
"RELATION" => ::core::option::Option::Some(Self::RELATION),
_ => ::core::option::Option::None,
}
}
fn values() -> &'static [Self] {
&[Self::NODE, Self::WAY, Self::RELATION]
}
}
}