#[allow(non_camel_case_types)]
#[derive(Clone, Copy, PartialEq, Eq, Hash, Debug)]
#[repr(i32)]
pub enum ResponseCode {
RESPONSE_CODE_UNSPECIFIED = 0i32,
RESPONSE_CODE_FOUND = 1i32,
RESPONSE_CODE_NOT_FOUND = 2i32,
RESPONSE_CODE_NOT_FOUND_FINALIZE = 4i32,
RESPONSE_CODE_NOT_FOUND_BLOCK_NOT_REACHED = 5i32,
}
impl ResponseCode {
#[allow(non_upper_case_globals)]
pub const Unspecified: Self = Self::RESPONSE_CODE_UNSPECIFIED;
#[allow(non_upper_case_globals)]
pub const Found: Self = Self::RESPONSE_CODE_FOUND;
#[allow(non_upper_case_globals)]
pub const NotFound: Self = Self::RESPONSE_CODE_NOT_FOUND;
#[allow(non_upper_case_globals)]
pub const NotFoundFinalize: Self = Self::RESPONSE_CODE_NOT_FOUND_FINALIZE;
#[allow(non_upper_case_globals)]
pub const NotFoundBlockNotReached: Self = Self::RESPONSE_CODE_NOT_FOUND_BLOCK_NOT_REACHED;
}
impl ::core::default::Default for ResponseCode {
fn default() -> Self {
Self::RESPONSE_CODE_UNSPECIFIED
}
}
impl ::buffa::Enumeration for ResponseCode {
fn from_i32(value: i32) -> ::core::option::Option<Self> {
match value {
0i32 => ::core::option::Option::Some(Self::RESPONSE_CODE_UNSPECIFIED),
1i32 => ::core::option::Option::Some(Self::RESPONSE_CODE_FOUND),
2i32 => ::core::option::Option::Some(Self::RESPONSE_CODE_NOT_FOUND),
4i32 => ::core::option::Option::Some(Self::RESPONSE_CODE_NOT_FOUND_FINALIZE),
5i32 => {
::core::option::Option::Some(
Self::RESPONSE_CODE_NOT_FOUND_BLOCK_NOT_REACHED,
)
}
_ => ::core::option::Option::None,
}
}
fn to_i32(&self) -> i32 {
*self as i32
}
fn proto_name(&self) -> &'static str {
match self {
Self::RESPONSE_CODE_UNSPECIFIED => "RESPONSE_CODE_UNSPECIFIED",
Self::RESPONSE_CODE_FOUND => "RESPONSE_CODE_FOUND",
Self::RESPONSE_CODE_NOT_FOUND => "RESPONSE_CODE_NOT_FOUND",
Self::RESPONSE_CODE_NOT_FOUND_FINALIZE => "RESPONSE_CODE_NOT_FOUND_FINALIZE",
Self::RESPONSE_CODE_NOT_FOUND_BLOCK_NOT_REACHED => {
"RESPONSE_CODE_NOT_FOUND_BLOCK_NOT_REACHED"
}
}
}
fn from_proto_name(name: &str) -> ::core::option::Option<Self> {
match name {
"RESPONSE_CODE_UNSPECIFIED" => {
::core::option::Option::Some(Self::RESPONSE_CODE_UNSPECIFIED)
}
"RESPONSE_CODE_FOUND" => {
::core::option::Option::Some(Self::RESPONSE_CODE_FOUND)
}
"RESPONSE_CODE_NOT_FOUND" => {
::core::option::Option::Some(Self::RESPONSE_CODE_NOT_FOUND)
}
"RESPONSE_CODE_NOT_FOUND_FINALIZE" => {
::core::option::Option::Some(Self::RESPONSE_CODE_NOT_FOUND_FINALIZE)
}
"RESPONSE_CODE_NOT_FOUND_BLOCK_NOT_REACHED" => {
::core::option::Option::Some(
Self::RESPONSE_CODE_NOT_FOUND_BLOCK_NOT_REACHED,
)
}
_ => ::core::option::Option::None,
}
}
fn values() -> &'static [Self] {
&[
Self::RESPONSE_CODE_UNSPECIFIED,
Self::RESPONSE_CODE_FOUND,
Self::RESPONSE_CODE_NOT_FOUND,
Self::RESPONSE_CODE_NOT_FOUND_FINALIZE,
Self::RESPONSE_CODE_NOT_FOUND_BLOCK_NOT_REACHED,
]
}
}
#[derive(Clone, PartialEq, Default)]
pub struct GetRequest {
pub block_number: u64,
pub block_hash: ::buffa::alloc::vec::Vec<u8>,
pub omit_deleted: bool,
pub key: ::buffa::alloc::vec::Vec<u8>,
}
impl ::core::fmt::Debug for GetRequest {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("GetRequest")
.field("block_number", &self.block_number)
.field("block_hash", &self.block_hash)
.field("omit_deleted", &self.omit_deleted)
.field("key", &self.key)
.finish()
}
}
impl GetRequest {
pub const TYPE_URL: &'static str = "type.googleapis.com/sf.substreams.foundational_store.v1.GetRequest";
}
::buffa::impl_default_instance!(GetRequest);
impl ::buffa::MessageName for GetRequest {
const PACKAGE: &'static str = "sf.substreams.foundational_store.v1";
const NAME: &'static str = "GetRequest";
const FULL_NAME: &'static str = "sf.substreams.foundational_store.v1.GetRequest";
const TYPE_URL: &'static str = "type.googleapis.com/sf.substreams.foundational_store.v1.GetRequest";
}
impl ::buffa::Message for GetRequest {
#[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.block_number != 0u64 {
size += 1u64 + ::buffa::types::uint64_encoded_len(self.block_number) as u64;
}
if !self.block_hash.is_empty() {
size += 1u64 + ::buffa::types::bytes_encoded_len(&self.block_hash) as u64;
}
if self.omit_deleted {
size += 1u64 + ::buffa::types::BOOL_ENCODED_LEN as u64;
}
if !self.key.is_empty() {
size += 1u64 + ::buffa::types::bytes_encoded_len(&self.key) 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.block_number != 0u64 {
::buffa::types::put_uint64_field(1u32, self.block_number, buf);
}
if !self.block_hash.is_empty() {
::buffa::types::put_shared_bytes_field(2u32, &self.block_hash, buf);
}
if self.omit_deleted {
::buffa::types::put_bool_field(3u32, self.omit_deleted, buf);
}
if !self.key.is_empty() {
::buffa::types::put_shared_bytes_field(4u32, &self.key, 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.block_number = ::buffa::types::decode_uint64(buf)?;
}
2u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::LengthDelimited,
)?;
::buffa::types::merge_bytes(&mut self.block_hash, buf)?;
}
3u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::Varint,
)?;
self.omit_deleted = ::buffa::types::decode_bool(buf)?;
}
4u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::LengthDelimited,
)?;
::buffa::types::merge_bytes(&mut self.key, buf)?;
}
_ => {
::buffa::encoding::skip_field_depth(tag, buf, ctx.depth())?;
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.block_number = 0u64;
self.block_hash.clear();
self.omit_deleted = false;
self.key.clear();
}
}
#[derive(Clone, PartialEq, Default)]
pub struct GetResponse {
pub block_reached: bool,
pub code: ::buffa::EnumValue<ResponseCode>,
pub value: ::buffa::MessageField<
::buffa_types::google::protobuf::Any,
::buffa::Inline<::buffa_types::google::protobuf::Any>,
>,
}
impl ::core::fmt::Debug for GetResponse {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("GetResponse")
.field("block_reached", &self.block_reached)
.field("code", &self.code)
.field("value", &self.value)
.finish()
}
}
impl GetResponse {
pub const TYPE_URL: &'static str = "type.googleapis.com/sf.substreams.foundational_store.v1.GetResponse";
}
::buffa::impl_default_instance!(GetResponse);
impl ::buffa::MessageName for GetResponse {
const PACKAGE: &'static str = "sf.substreams.foundational_store.v1";
const NAME: &'static str = "GetResponse";
const FULL_NAME: &'static str = "sf.substreams.foundational_store.v1.GetResponse";
const TYPE_URL: &'static str = "type.googleapis.com/sf.substreams.foundational_store.v1.GetResponse";
}
impl ::buffa::Message for GetResponse {
#[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.block_reached {
size += 1u64 + ::buffa::types::BOOL_ENCODED_LEN as u64;
}
{
let val = self.code.to_i32();
if val != 0 {
size += 1u64 + ::buffa::types::int32_encoded_len(val) as u64;
}
}
if self.value.is_set() {
let __slot = __cache.reserve();
let inner_size = self.value.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 _;
if self.block_reached {
::buffa::types::put_bool_field(3u32, self.block_reached, buf);
}
{
let val = self.code.to_i32();
if val != 0 {
::buffa::types::put_int32_field(4u32, val, buf);
}
}
if self.value.is_set() {
::buffa::types::put_len_delimited_header(
5u32,
u64::from(__cache.consume_next()),
buf,
);
self.value.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() {
3u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::Varint,
)?;
self.block_reached = ::buffa::types::decode_bool(buf)?;
}
4u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::Varint,
)?;
self.code = ::buffa::EnumValue::from(::buffa::types::decode_int32(buf)?);
}
5u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::LengthDelimited,
)?;
::buffa::Message::merge_length_delimited(
self.value.get_or_insert_default(),
buf,
ctx,
)?;
}
_ => {
::buffa::encoding::skip_field_depth(tag, buf, ctx.depth())?;
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.block_reached = false;
self.code = ::buffa::EnumValue::from(0);
self.value = ::buffa::MessageField::none();
}
}
#[derive(Clone, PartialEq, Default)]
pub struct GetAllRequest {
pub block_number: u64,
pub block_hash: ::buffa::alloc::vec::Vec<u8>,
pub omit_deleted: bool,
pub keys: ::buffa::alloc::vec::Vec<::buffa::alloc::vec::Vec<u8>>,
}
impl ::core::fmt::Debug for GetAllRequest {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("GetAllRequest")
.field("block_number", &self.block_number)
.field("block_hash", &self.block_hash)
.field("omit_deleted", &self.omit_deleted)
.field("keys", &self.keys)
.finish()
}
}
impl GetAllRequest {
pub const TYPE_URL: &'static str = "type.googleapis.com/sf.substreams.foundational_store.v1.GetAllRequest";
}
::buffa::impl_default_instance!(GetAllRequest);
impl ::buffa::MessageName for GetAllRequest {
const PACKAGE: &'static str = "sf.substreams.foundational_store.v1";
const NAME: &'static str = "GetAllRequest";
const FULL_NAME: &'static str = "sf.substreams.foundational_store.v1.GetAllRequest";
const TYPE_URL: &'static str = "type.googleapis.com/sf.substreams.foundational_store.v1.GetAllRequest";
}
impl ::buffa::Message for GetAllRequest {
#[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.block_number != 0u64 {
size += 1u64 + ::buffa::types::uint64_encoded_len(self.block_number) as u64;
}
if !self.block_hash.is_empty() {
size += 1u64 + ::buffa::types::bytes_encoded_len(&self.block_hash) as u64;
}
if self.omit_deleted {
size += 1u64 + ::buffa::types::BOOL_ENCODED_LEN as u64;
}
for v in &self.keys {
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 _;
if self.block_number != 0u64 {
::buffa::types::put_uint64_field(1u32, self.block_number, buf);
}
if !self.block_hash.is_empty() {
::buffa::types::put_shared_bytes_field(2u32, &self.block_hash, buf);
}
if self.omit_deleted {
::buffa::types::put_bool_field(3u32, self.omit_deleted, buf);
}
for v in &self.keys {
::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::Varint,
)?;
self.block_number = ::buffa::types::decode_uint64(buf)?;
}
2u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::LengthDelimited,
)?;
::buffa::types::merge_bytes(&mut self.block_hash, buf)?;
}
3u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::Varint,
)?;
self.omit_deleted = ::buffa::types::decode_bool(buf)?;
}
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.keys.push(__elem);
}
_ => {
::buffa::encoding::skip_field_depth(tag, buf, ctx.depth())?;
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.block_number = 0u64;
self.block_hash.clear();
self.omit_deleted = false;
self.keys.clear();
}
}
#[derive(Clone, PartialEq, Default)]
pub struct ResponseEntry {
pub key: ::buffa::alloc::vec::Vec<u8>,
pub response: ::buffa::MessageField<GetResponse, ::buffa::Inline<GetResponse>>,
}
impl ::core::fmt::Debug for ResponseEntry {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("ResponseEntry")
.field("key", &self.key)
.field("response", &self.response)
.finish()
}
}
impl ResponseEntry {
pub const TYPE_URL: &'static str = "type.googleapis.com/sf.substreams.foundational_store.v1.ResponseEntry";
}
::buffa::impl_default_instance!(ResponseEntry);
impl ::buffa::MessageName for ResponseEntry {
const PACKAGE: &'static str = "sf.substreams.foundational_store.v1";
const NAME: &'static str = "ResponseEntry";
const FULL_NAME: &'static str = "sf.substreams.foundational_store.v1.ResponseEntry";
const TYPE_URL: &'static str = "type.googleapis.com/sf.substreams.foundational_store.v1.ResponseEntry";
}
impl ::buffa::Message for ResponseEntry {
#[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.key.is_empty() {
size += 1u64 + ::buffa::types::bytes_encoded_len(&self.key) as u64;
}
if self.response.is_set() {
let __slot = __cache.reserve();
let inner_size = self.response.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 _;
if !self.key.is_empty() {
::buffa::types::put_shared_bytes_field(1u32, &self.key, buf);
}
if self.response.is_set() {
::buffa::types::put_len_delimited_header(
2u32,
u64::from(__cache.consume_next()),
buf,
);
self.response.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,
)?;
::buffa::types::merge_bytes(&mut self.key, buf)?;
}
2u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::LengthDelimited,
)?;
::buffa::Message::merge_length_delimited(
self.response.get_or_insert_default(),
buf,
ctx,
)?;
}
_ => {
::buffa::encoding::skip_field_depth(tag, buf, ctx.depth())?;
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.key.clear();
self.response = ::buffa::MessageField::none();
}
}
#[derive(Clone, PartialEq, Default)]
pub struct GetAllResponse {
pub entries: ::buffa::alloc::vec::Vec<ResponseEntry>,
pub block_reached: bool,
}
impl ::core::fmt::Debug for GetAllResponse {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("GetAllResponse")
.field("entries", &self.entries)
.field("block_reached", &self.block_reached)
.finish()
}
}
impl GetAllResponse {
pub const TYPE_URL: &'static str = "type.googleapis.com/sf.substreams.foundational_store.v1.GetAllResponse";
}
::buffa::impl_default_instance!(GetAllResponse);
impl ::buffa::MessageName for GetAllResponse {
const PACKAGE: &'static str = "sf.substreams.foundational_store.v1";
const NAME: &'static str = "GetAllResponse";
const FULL_NAME: &'static str = "sf.substreams.foundational_store.v1.GetAllResponse";
const TYPE_URL: &'static str = "type.googleapis.com/sf.substreams.foundational_store.v1.GetAllResponse";
}
impl ::buffa::Message for GetAllResponse {
#[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.entries {
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.block_reached {
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 _;
for v in &self.entries {
::buffa::types::put_len_delimited_header(
1u32,
u64::from(__cache.consume_next()),
buf,
);
v.write_to(__cache, buf);
}
if self.block_reached {
::buffa::types::put_bool_field(2u32, self.block_reached, 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.entries.push(elem);
}
2u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::Varint,
)?;
self.block_reached = ::buffa::types::decode_bool(buf)?;
}
_ => {
::buffa::encoding::skip_field_depth(tag, buf, ctx.depth())?;
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.entries.clear();
self.block_reached = false;
}
}
#[derive(Clone, PartialEq, Default)]
pub struct Entry {
pub key: ::buffa::alloc::vec::Vec<u8>,
pub value: ::buffa::MessageField<
::buffa_types::google::protobuf::Any,
::buffa::Inline<::buffa_types::google::protobuf::Any>,
>,
}
impl ::core::fmt::Debug for Entry {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("Entry")
.field("key", &self.key)
.field("value", &self.value)
.finish()
}
}
impl Entry {
pub const TYPE_URL: &'static str = "type.googleapis.com/sf.substreams.foundational_store.v1.Entry";
}
::buffa::impl_default_instance!(Entry);
impl ::buffa::MessageName for Entry {
const PACKAGE: &'static str = "sf.substreams.foundational_store.v1";
const NAME: &'static str = "Entry";
const FULL_NAME: &'static str = "sf.substreams.foundational_store.v1.Entry";
const TYPE_URL: &'static str = "type.googleapis.com/sf.substreams.foundational_store.v1.Entry";
}
impl ::buffa::Message for Entry {
#[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.key.is_empty() {
size += 1u64 + ::buffa::types::bytes_encoded_len(&self.key) as u64;
}
if self.value.is_set() {
let __slot = __cache.reserve();
let inner_size = self.value.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 _;
if !self.key.is_empty() {
::buffa::types::put_shared_bytes_field(2u32, &self.key, buf);
}
if self.value.is_set() {
::buffa::types::put_len_delimited_header(
4u32,
u64::from(__cache.consume_next()),
buf,
);
self.value.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() {
2u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::LengthDelimited,
)?;
::buffa::types::merge_bytes(&mut self.key, buf)?;
}
4u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::LengthDelimited,
)?;
::buffa::Message::merge_length_delimited(
self.value.get_or_insert_default(),
buf,
ctx,
)?;
}
_ => {
::buffa::encoding::skip_field_depth(tag, buf, ctx.depth())?;
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.key.clear();
self.value = ::buffa::MessageField::none();
}
}
#[derive(Clone, PartialEq, Default)]
pub struct Entries {
pub entries: ::buffa::alloc::vec::Vec<Entry>,
}
impl ::core::fmt::Debug for Entries {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("Entries").field("entries", &self.entries).finish()
}
}
impl Entries {
pub const TYPE_URL: &'static str = "type.googleapis.com/sf.substreams.foundational_store.v1.Entries";
}
::buffa::impl_default_instance!(Entries);
impl ::buffa::MessageName for Entries {
const PACKAGE: &'static str = "sf.substreams.foundational_store.v1";
const NAME: &'static str = "Entries";
const FULL_NAME: &'static str = "sf.substreams.foundational_store.v1.Entries";
const TYPE_URL: &'static str = "type.googleapis.com/sf.substreams.foundational_store.v1.Entries";
}
impl ::buffa::Message for Entries {
#[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.entries {
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.entries {
::buffa::types::put_len_delimited_header(
1u32,
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.entries.push(elem);
}
_ => {
::buffa::encoding::skip_field_depth(tag, buf, ctx.depth())?;
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.entries.clear();
}
}