#[derive(Clone, PartialEq, Default)]
pub struct Blob {
pub raw_size: ::core::option::Option<i32>,
pub data: ::core::option::Option<__buffa::oneof::blob::Data>,
}
impl ::core::fmt::Debug for Blob {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("Blob")
.field("raw_size", &self.raw_size)
.field("data", &self.data)
.finish()
}
}
impl Blob {
pub const TYPE_URL: &'static str = "type.googleapis.com/osmflow_raw.Blob";
}
impl Blob {
#[must_use = "with_* setters return `self` by value; assign or chain the result"]
#[inline]
pub fn with_raw_size(mut self, value: i32) -> Self {
self.raw_size = Some(value);
self
}
}
::buffa::impl_default_instance!(Blob);
impl ::buffa::MessageName for Blob {
const PACKAGE: &'static str = "osmflow_raw";
const NAME: &'static str = "Blob";
const FULL_NAME: &'static str = "osmflow_raw.Blob";
const TYPE_URL: &'static str = "type.googleapis.com/osmflow_raw.Blob";
}
impl ::buffa::Message for Blob {
#[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 ::core::option::Option::Some(ref v) = self.data {
match v {
__buffa::oneof::blob::Data::Raw(x) => {
size += 1u64 + ::buffa::types::bytes_encoded_len(x) as u64;
}
__buffa::oneof::blob::Data::ZlibData(x) => {
size += 1u64 + ::buffa::types::bytes_encoded_len(x) as u64;
}
__buffa::oneof::blob::Data::LzmaData(x) => {
size += 1u64 + ::buffa::types::bytes_encoded_len(x) as u64;
}
__buffa::oneof::blob::Data::OBSOLETEBzip2Data(x) => {
size += 1u64 + ::buffa::types::bytes_encoded_len(x) as u64;
}
__buffa::oneof::blob::Data::Lz4Data(x) => {
size += 1u64 + ::buffa::types::bytes_encoded_len(x) as u64;
}
__buffa::oneof::blob::Data::ZstdData(x) => {
size += 1u64 + ::buffa::types::bytes_encoded_len(x) as u64;
}
}
}
if let Some(v) = self.raw_size {
size += 1u64 + ::buffa::types::int32_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 let ::core::option::Option::Some(ref v) = self.data {
match v {
__buffa::oneof::blob::Data::Raw(x) => {
::buffa::types::put_shared_bytes_field(1u32, x, buf);
}
__buffa::oneof::blob::Data::ZlibData(x) => {
::buffa::types::put_shared_bytes_field(3u32, x, buf);
}
__buffa::oneof::blob::Data::LzmaData(x) => {
::buffa::types::put_shared_bytes_field(4u32, x, buf);
}
__buffa::oneof::blob::Data::OBSOLETEBzip2Data(x) => {
::buffa::types::put_shared_bytes_field(5u32, x, buf);
}
__buffa::oneof::blob::Data::Lz4Data(x) => {
::buffa::types::put_shared_bytes_field(6u32, x, buf);
}
__buffa::oneof::blob::Data::ZstdData(x) => {
::buffa::types::put_shared_bytes_field(7u32, x, buf);
}
}
}
if let Some(v) = self.raw_size {
::buffa::types::put_int32_field(2u32, 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,
)?;
self.data = ::core::option::Option::Some(
__buffa::oneof::blob::Data::Raw(::buffa::types::decode_bytes(buf)?),
);
}
3u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::LengthDelimited,
)?;
self.data = ::core::option::Option::Some(
__buffa::oneof::blob::Data::ZlibData(
::buffa::types::decode_bytes(buf)?,
),
);
}
4u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::LengthDelimited,
)?;
self.data = ::core::option::Option::Some(
__buffa::oneof::blob::Data::LzmaData(
::buffa::types::decode_bytes(buf)?,
),
);
}
5u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::LengthDelimited,
)?;
self.data = ::core::option::Option::Some(
__buffa::oneof::blob::Data::OBSOLETEBzip2Data(
::buffa::types::decode_bytes(buf)?,
),
);
}
6u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::LengthDelimited,
)?;
self.data = ::core::option::Option::Some(
__buffa::oneof::blob::Data::Lz4Data(
::buffa::types::decode_bytes(buf)?,
),
);
}
7u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::LengthDelimited,
)?;
self.data = ::core::option::Option::Some(
__buffa::oneof::blob::Data::ZstdData(
::buffa::types::decode_bytes(buf)?,
),
);
}
2u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::Varint,
)?;
self.raw_size = ::core::option::Option::Some(
::buffa::types::decode_int32(buf)?,
);
}
_ => {
::buffa::encoding::skip_field_depth(tag, buf, ctx.depth())?;
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.data = ::core::option::Option::None;
self.raw_size = ::core::option::Option::None;
}
}
pub mod blob {
#[allow(unused_imports)]
use super::*;
#[doc(inline)]
pub use super::__buffa::oneof::blob::Data;
#[doc(inline)]
pub use super::__buffa::view::oneof::blob::Data as DataView;
}
#[derive(Clone, PartialEq, Default)]
pub struct BlobHeader {
pub r#type: ::core::option::Option<::buffa::alloc::vec::Vec<u8>>,
pub datasize: ::core::option::Option<i32>,
}
impl ::core::fmt::Debug for BlobHeader {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("BlobHeader")
.field("type", &self.r#type)
.field("datasize", &self.datasize)
.finish()
}
}
impl BlobHeader {
pub const TYPE_URL: &'static str = "type.googleapis.com/osmflow_raw.BlobHeader";
}
impl BlobHeader {
#[must_use = "with_* setters return `self` by value; assign or chain the result"]
#[inline]
pub fn with_type(mut self, value: impl Into<::buffa::alloc::vec::Vec<u8>>) -> Self {
self.r#type = Some(value.into());
self
}
#[must_use = "with_* setters return `self` by value; assign or chain the result"]
#[inline]
pub fn with_datasize(mut self, value: i32) -> Self {
self.datasize = Some(value);
self
}
}
::buffa::impl_default_instance!(BlobHeader);
impl ::buffa::MessageName for BlobHeader {
const PACKAGE: &'static str = "osmflow_raw";
const NAME: &'static str = "BlobHeader";
const FULL_NAME: &'static str = "osmflow_raw.BlobHeader";
const TYPE_URL: &'static str = "type.googleapis.com/osmflow_raw.BlobHeader";
}
impl ::buffa::Message for BlobHeader {
#[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(ref v) = self.r#type {
size += 1u64 + ::buffa::types::bytes_encoded_len(v) as u64;
}
if let Some(v) = self.datasize {
size += 1u64 + ::buffa::types::int32_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 let Some(ref v) = self.r#type {
::buffa::types::put_shared_bytes_field(1u32, v, buf);
}
if let Some(v) = self.datasize {
::buffa::types::put_int32_field(3u32, 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::types::merge_bytes(
self.r#type.get_or_insert_with(::buffa::alloc::vec::Vec::new),
buf,
)?;
}
3u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::Varint,
)?;
self.datasize = ::core::option::Option::Some(
::buffa::types::decode_int32(buf)?,
);
}
_ => {
::buffa::encoding::skip_field_depth(tag, buf, ctx.depth())?;
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.r#type = ::core::option::Option::None;
self.datasize = ::core::option::Option::None;
}
}
#[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 date_granularity: ::core::option::Option<i32>,
pub lat_offset: ::core::option::Option<i64>,
pub lon_offset: ::core::option::Option<i64>,
}
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("date_granularity", &self.date_granularity)
.field("lat_offset", &self.lat_offset)
.field("lon_offset", &self.lon_offset)
.finish()
}
}
impl PrimitiveBlock {
pub const TYPE_URL: &'static str = "type.googleapis.com/osmflow_raw.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_date_granularity(mut self, value: i32) -> Self {
self.date_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
}
}
::buffa::impl_default_instance!(PrimitiveBlock);
impl ::buffa::MessageName for PrimitiveBlock {
const PACKAGE: &'static str = "osmflow_raw";
const NAME: &'static str = "PrimitiveBlock";
const FULL_NAME: &'static str = "osmflow_raw.PrimitiveBlock";
const TYPE_URL: &'static str = "type.googleapis.com/osmflow_raw.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 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/osmflow_raw.StringTable";
}
::buffa::impl_default_instance!(StringTable);
impl ::buffa::MessageName for StringTable {
const PACKAGE: &'static str = "osmflow_raw";
const NAME: &'static str = "StringTable";
const FULL_NAME: &'static str = "osmflow_raw.StringTable";
const TYPE_URL: &'static str = "type.googleapis.com/osmflow_raw.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 PrimitiveGroup {
pub nodes: ::buffa::alloc::vec::Vec<::buffa::alloc::vec::Vec<u8>>,
pub dense: ::buffa::alloc::vec::Vec<::buffa::alloc::vec::Vec<u8>>,
pub ways: ::buffa::alloc::vec::Vec<::buffa::alloc::vec::Vec<u8>>,
pub relations: ::buffa::alloc::vec::Vec<::buffa::alloc::vec::Vec<u8>>,
}
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)
.finish()
}
}
impl PrimitiveGroup {
pub const TYPE_URL: &'static str = "type.googleapis.com/osmflow_raw.PrimitiveGroup";
}
::buffa::impl_default_instance!(PrimitiveGroup);
impl ::buffa::MessageName for PrimitiveGroup {
const PACKAGE: &'static str = "osmflow_raw";
const NAME: &'static str = "PrimitiveGroup";
const FULL_NAME: &'static str = "osmflow_raw.PrimitiveGroup";
const TYPE_URL: &'static str = "type.googleapis.com/osmflow_raw.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 {
size += 1u64 + ::buffa::types::bytes_encoded_len(v) as u64;
}
for v in &self.dense {
size += 1u64 + ::buffa::types::bytes_encoded_len(v) as u64;
}
for v in &self.ways {
size += 1u64 + ::buffa::types::bytes_encoded_len(v) as u64;
}
for v in &self.relations {
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.nodes {
::buffa::types::put_shared_bytes_field(1u32, v, buf);
}
for v in &self.dense {
::buffa::types::put_shared_bytes_field(2u32, v, buf);
}
for v in &self.ways {
::buffa::types::put_shared_bytes_field(3u32, v, buf);
}
for v in &self.relations {
::buffa::types::put_shared_bytes_field(4u32, 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.nodes.push(__elem);
}
2u32 => {
::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.dense.push(__elem);
}
3u32 => {
::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.ways.push(__elem);
}
4u32 => {
::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.relations.push(__elem);
}
_ => {
::buffa::encoding::skip_field_depth(tag, buf, ctx.depth())?;
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.nodes.clear();
self.dense.clear();
self.ways.clear();
self.relations.clear();
}
}
#[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/osmflow_raw.DenseInfo";
}
::buffa::impl_default_instance!(DenseInfo);
impl ::buffa::MessageName for DenseInfo {
const PACKAGE: &'static str = "osmflow_raw";
const NAME: &'static str = "DenseInfo";
const FULL_NAME: &'static str = "osmflow_raw.DenseInfo";
const TYPE_URL: &'static str = "type.googleapis.com/osmflow_raw.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 DenseNodes {
pub id: ::buffa::alloc::vec::Vec<i64>,
pub denseinfo: ::buffa::alloc::vec::Vec<::buffa::alloc::vec::Vec<u8>>,
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/osmflow_raw.DenseNodes";
}
::buffa::impl_default_instance!(DenseNodes);
impl ::buffa::MessageName for DenseNodes {
const PACKAGE: &'static str = "osmflow_raw";
const NAME: &'static str = "DenseNodes";
const FULL_NAME: &'static str = "osmflow_raw.DenseNodes";
const TYPE_URL: &'static str = "type.googleapis.com/osmflow_raw.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;
}
for v in &self.denseinfo {
size += 1u64 + ::buffa::types::bytes_encoded_len(v) 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);
}
}
for v in &self.denseinfo {
::buffa::types::put_shared_bytes_field(5u32, 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(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,
)?;
let __elem = ::buffa::types::decode_bytes(buf)?;
ctx.register_element_memory(
::buffa::__private::element_footprint(&__elem),
)?;
self.denseinfo.push(__elem);
}
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.clear();
self.lat.clear();
self.lon.clear();
self.keys_vals.clear();
}
}
#[derive(Clone, PartialEq, Default)]
pub struct DenseNodeLocations {
pub id: ::buffa::alloc::vec::Vec<i64>,
pub lat: ::buffa::alloc::vec::Vec<i64>,
pub lon: ::buffa::alloc::vec::Vec<i64>,
}
impl ::core::fmt::Debug for DenseNodeLocations {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("DenseNodeLocations")
.field("id", &self.id)
.field("lat", &self.lat)
.field("lon", &self.lon)
.finish()
}
}
impl DenseNodeLocations {
pub const TYPE_URL: &'static str = "type.googleapis.com/osmflow_raw.DenseNodeLocations";
}
::buffa::impl_default_instance!(DenseNodeLocations);
impl ::buffa::MessageName for DenseNodeLocations {
const PACKAGE: &'static str = "osmflow_raw";
const NAME: &'static str = "DenseNodeLocations";
const FULL_NAME: &'static str = "osmflow_raw.DenseNodeLocations";
const TYPE_URL: &'static str = "type.googleapis.com/osmflow_raw.DenseNodeLocations";
}
impl ::buffa::Message for DenseNodeLocations {
#[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.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 _;
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.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);
}
}
}
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,
),
);
}
}
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,
),
);
}
}
_ => {
::buffa::encoding::skip_field_depth(tag, buf, ctx.depth())?;
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.id.clear();
self.lat.clear();
self.lon.clear();
}
}