#[derive(Clone, PartialEq, Default)]
pub struct Keys {
pub keys: ::buffa::alloc::vec::Vec<::buffa::alloc::string::String>,
}
impl ::core::fmt::Debug for Keys {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("Keys").field("keys", &self.keys).finish()
}
}
impl Keys {
pub const TYPE_URL: &'static str = "type.googleapis.com/sf.substreams.index.v1.Keys";
}
::buffa::impl_default_instance!(Keys);
impl ::buffa::MessageName for Keys {
const PACKAGE: &'static str = "sf.substreams.index.v1";
const NAME: &'static str = "Keys";
const FULL_NAME: &'static str = "sf.substreams.index.v1.Keys";
const TYPE_URL: &'static str = "type.googleapis.com/sf.substreams.index.v1.Keys";
}
impl ::buffa::Message for Keys {
#[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.keys {
size += 1u64 + ::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 _;
for v in &self.keys {
::buffa::types::put_string_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_string(buf)?;
ctx.register_element_memory(
::buffa::__private::element_footprint(&__elem),
)?;
self.keys.push(__elem);
}
_ => {
::buffa::encoding::skip_field_depth(tag, buf, ctx.depth())?;
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.keys.clear();
}
}