#[derive(Clone, PartialEq, Default)]
pub struct Modules {
pub modules: ::buffa::alloc::vec::Vec<Module>,
pub binaries: ::buffa::alloc::vec::Vec<Binary>,
}
impl ::core::fmt::Debug for Modules {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("Modules")
.field("modules", &self.modules)
.field("binaries", &self.binaries)
.finish()
}
}
impl Modules {
pub const TYPE_URL: &'static str = "type.googleapis.com/sf.substreams.v1.Modules";
}
::buffa::impl_default_instance!(Modules);
impl ::buffa::MessageName for Modules {
const PACKAGE: &'static str = "sf.substreams.v1";
const NAME: &'static str = "Modules";
const FULL_NAME: &'static str = "sf.substreams.v1.Modules";
const TYPE_URL: &'static str = "type.googleapis.com/sf.substreams.v1.Modules";
}
impl ::buffa::Message for Modules {
#[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.modules {
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.binaries {
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.modules {
::buffa::types::put_len_delimited_header(
1u32,
u64::from(__cache.consume_next()),
buf,
);
v.write_to(__cache, buf);
}
for v in &self.binaries {
::buffa::types::put_len_delimited_header(
2u32,
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.modules.push(elem);
}
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.binaries.push(elem);
}
_ => {
::buffa::encoding::skip_field_depth(tag, buf, ctx.depth())?;
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.modules.clear();
self.binaries.clear();
}
}
#[derive(Clone, PartialEq, Default)]
pub struct Binary {
pub r#type: ::buffa::alloc::string::String,
pub content: ::buffa::alloc::vec::Vec<u8>,
}
impl ::core::fmt::Debug for Binary {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("Binary")
.field("type", &self.r#type)
.field("content", &self.content)
.finish()
}
}
impl Binary {
pub const TYPE_URL: &'static str = "type.googleapis.com/sf.substreams.v1.Binary";
}
::buffa::impl_default_instance!(Binary);
impl ::buffa::MessageName for Binary {
const PACKAGE: &'static str = "sf.substreams.v1";
const NAME: &'static str = "Binary";
const FULL_NAME: &'static str = "sf.substreams.v1.Binary";
const TYPE_URL: &'static str = "type.googleapis.com/sf.substreams.v1.Binary";
}
impl ::buffa::Message for Binary {
#[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.r#type.is_empty() {
size += 1u64 + ::buffa::types::string_encoded_len(&self.r#type) as u64;
}
if !self.content.is_empty() {
size += 1u64 + ::buffa::types::bytes_encoded_len(&self.content) 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.r#type.is_empty() {
::buffa::types::put_string_field(1u32, &self.r#type, buf);
}
if !self.content.is_empty() {
::buffa::types::put_shared_bytes_field(2u32, &self.content, 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_string(&mut self.r#type, buf)?;
}
2u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::LengthDelimited,
)?;
::buffa::types::merge_bytes(&mut self.content, buf)?;
}
_ => {
::buffa::encoding::skip_field_depth(tag, buf, ctx.depth())?;
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.r#type.clear();
self.content.clear();
}
}
#[derive(Clone, PartialEq, Default)]
pub struct Module {
pub name: ::buffa::alloc::string::String,
pub binary_index: u32,
pub binary_entrypoint: ::buffa::alloc::string::String,
pub inputs: ::buffa::alloc::vec::Vec<module::Input>,
pub output: ::buffa::MessageField<module::Output, ::buffa::Inline<module::Output>>,
pub initial_block: u64,
pub block_filter: ::buffa::MessageField<
module::BlockFilter,
::buffa::Inline<module::BlockFilter>,
>,
pub kind: ::core::option::Option<__buffa::oneof::module::Kind>,
}
impl ::core::fmt::Debug for Module {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("Module")
.field("name", &self.name)
.field("binary_index", &self.binary_index)
.field("binary_entrypoint", &self.binary_entrypoint)
.field("inputs", &self.inputs)
.field("output", &self.output)
.field("initial_block", &self.initial_block)
.field("block_filter", &self.block_filter)
.field("kind", &self.kind)
.finish()
}
}
impl Module {
pub const TYPE_URL: &'static str = "type.googleapis.com/sf.substreams.v1.Module";
}
::buffa::impl_default_instance!(Module);
impl ::buffa::MessageName for Module {
const PACKAGE: &'static str = "sf.substreams.v1";
const NAME: &'static str = "Module";
const FULL_NAME: &'static str = "sf.substreams.v1.Module";
const TYPE_URL: &'static str = "type.googleapis.com/sf.substreams.v1.Module";
}
impl ::buffa::Message for Module {
#[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.name.is_empty() {
size += 1u64 + ::buffa::types::string_encoded_len(&self.name) as u64;
}
if let ::core::option::Option::Some(ref v) = self.kind {
match v {
__buffa::oneof::module::Kind::KindMap(x) => {
let __slot = __cache.reserve();
let inner = x.compute_size(__cache);
__cache.set(__slot, inner);
size
+= 1u64 + ::buffa::encoding::varint_len(inner as u64) as u64
+ inner as u64;
}
__buffa::oneof::module::Kind::KindStore(x) => {
let __slot = __cache.reserve();
let inner = x.compute_size(__cache);
__cache.set(__slot, inner);
size
+= 1u64 + ::buffa::encoding::varint_len(inner as u64) as u64
+ inner as u64;
}
__buffa::oneof::module::Kind::KindBlockIndex(x) => {
let __slot = __cache.reserve();
let inner = x.compute_size(__cache);
__cache.set(__slot, inner);
size
+= 1u64 + ::buffa::encoding::varint_len(inner as u64) as u64
+ inner as u64;
}
}
}
if self.binary_index != 0u32 {
size += 1u64 + ::buffa::types::uint32_encoded_len(self.binary_index) as u64;
}
if !self.binary_entrypoint.is_empty() {
size
+= 1u64
+ ::buffa::types::string_encoded_len(&self.binary_entrypoint) as u64;
}
for v in &self.inputs {
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.output.is_set() {
let __slot = __cache.reserve();
let inner_size = self.output.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.initial_block != 0u64 {
size += 1u64 + ::buffa::types::uint64_encoded_len(self.initial_block) as u64;
}
if self.block_filter.is_set() {
let __slot = __cache.reserve();
let inner_size = self.block_filter.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.name.is_empty() {
::buffa::types::put_string_field(1u32, &self.name, buf);
}
if let ::core::option::Option::Some(ref v) = self.kind {
match v {
__buffa::oneof::module::Kind::KindMap(x) => {
::buffa::types::put_len_delimited_header(
2u32,
u64::from(__cache.consume_next()),
buf,
);
x.write_to(__cache, buf);
}
__buffa::oneof::module::Kind::KindStore(x) => {
::buffa::types::put_len_delimited_header(
3u32,
u64::from(__cache.consume_next()),
buf,
);
x.write_to(__cache, buf);
}
__buffa::oneof::module::Kind::KindBlockIndex(x) => {
::buffa::types::put_len_delimited_header(
10u32,
u64::from(__cache.consume_next()),
buf,
);
x.write_to(__cache, buf);
}
}
}
if self.binary_index != 0u32 {
::buffa::types::put_uint32_field(4u32, self.binary_index, buf);
}
if !self.binary_entrypoint.is_empty() {
::buffa::types::put_string_field(5u32, &self.binary_entrypoint, buf);
}
for v in &self.inputs {
::buffa::types::put_len_delimited_header(
6u32,
u64::from(__cache.consume_next()),
buf,
);
v.write_to(__cache, buf);
}
if self.output.is_set() {
::buffa::types::put_len_delimited_header(
7u32,
u64::from(__cache.consume_next()),
buf,
);
self.output.write_to(__cache, buf);
}
if self.initial_block != 0u64 {
::buffa::types::put_uint64_field(8u32, self.initial_block, buf);
}
if self.block_filter.is_set() {
::buffa::types::put_len_delimited_header(
9u32,
u64::from(__cache.consume_next()),
buf,
);
self.block_filter.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_string(&mut self.name, buf)?;
}
2u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::LengthDelimited,
)?;
if let ::core::option::Option::Some(
__buffa::oneof::module::Kind::KindMap(ref mut existing),
) = self.kind
{
::buffa::Message::merge_length_delimited(&mut **existing, buf, ctx)?;
} else {
let mut val = ::core::default::Default::default();
::buffa::Message::merge_length_delimited(&mut val, buf, ctx)?;
self.kind = ::core::option::Option::Some(
__buffa::oneof::module::Kind::KindMap(
::buffa::alloc::boxed::Box::new(val),
),
);
}
}
3u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::LengthDelimited,
)?;
if let ::core::option::Option::Some(
__buffa::oneof::module::Kind::KindStore(ref mut existing),
) = self.kind
{
::buffa::Message::merge_length_delimited(&mut **existing, buf, ctx)?;
} else {
let mut val = ::core::default::Default::default();
::buffa::Message::merge_length_delimited(&mut val, buf, ctx)?;
self.kind = ::core::option::Option::Some(
__buffa::oneof::module::Kind::KindStore(
::buffa::alloc::boxed::Box::new(val),
),
);
}
}
10u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::LengthDelimited,
)?;
if let ::core::option::Option::Some(
__buffa::oneof::module::Kind::KindBlockIndex(ref mut existing),
) = self.kind
{
::buffa::Message::merge_length_delimited(&mut **existing, buf, ctx)?;
} else {
let mut val = ::core::default::Default::default();
::buffa::Message::merge_length_delimited(&mut val, buf, ctx)?;
self.kind = ::core::option::Option::Some(
__buffa::oneof::module::Kind::KindBlockIndex(
::buffa::alloc::boxed::Box::new(val),
),
);
}
}
4u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::Varint,
)?;
self.binary_index = ::buffa::types::decode_uint32(buf)?;
}
5u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::LengthDelimited,
)?;
::buffa::types::merge_string(&mut self.binary_entrypoint, buf)?;
}
6u32 => {
::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.inputs.push(elem);
}
7u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::LengthDelimited,
)?;
::buffa::Message::merge_length_delimited(
self.output.get_or_insert_default(),
buf,
ctx,
)?;
}
8u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::Varint,
)?;
self.initial_block = ::buffa::types::decode_uint64(buf)?;
}
9u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::LengthDelimited,
)?;
::buffa::Message::merge_length_delimited(
self.block_filter.get_or_insert_default(),
buf,
ctx,
)?;
}
_ => {
::buffa::encoding::skip_field_depth(tag, buf, ctx.depth())?;
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.name.clear();
self.kind = ::core::option::Option::None;
self.binary_index = 0u32;
self.binary_entrypoint.clear();
self.inputs.clear();
self.output = ::buffa::MessageField::none();
self.initial_block = 0u64;
self.block_filter = ::buffa::MessageField::none();
}
}
pub mod module {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, PartialEq, Default)]
pub struct BlockFilter {
pub module: ::buffa::alloc::string::String,
pub query: ::core::option::Option<
super::__buffa::oneof::module::block_filter::Query,
>,
}
impl ::core::fmt::Debug for BlockFilter {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("BlockFilter")
.field("module", &self.module)
.field("query", &self.query)
.finish()
}
}
impl BlockFilter {
pub const TYPE_URL: &'static str = "type.googleapis.com/sf.substreams.v1.Module.BlockFilter";
}
::buffa::impl_default_instance!(BlockFilter);
impl ::buffa::MessageName for BlockFilter {
const PACKAGE: &'static str = "sf.substreams.v1";
const NAME: &'static str = "Module.BlockFilter";
const FULL_NAME: &'static str = "sf.substreams.v1.Module.BlockFilter";
const TYPE_URL: &'static str = "type.googleapis.com/sf.substreams.v1.Module.BlockFilter";
}
impl ::buffa::Message for BlockFilter {
#[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.module.is_empty() {
size += 1u64 + ::buffa::types::string_encoded_len(&self.module) as u64;
}
if let ::core::option::Option::Some(ref v) = self.query {
match v {
super::__buffa::oneof::module::block_filter::Query::QueryString(
x,
) => {
size += 1u64 + ::buffa::types::string_encoded_len(x) as u64;
}
super::__buffa::oneof::module::block_filter::Query::QueryFromParams(
x,
) => {
let __slot = __cache.reserve();
let inner = x.compute_size(__cache);
__cache.set(__slot, inner);
size
+= 1u64 + ::buffa::encoding::varint_len(inner as u64) as u64
+ inner 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.module.is_empty() {
::buffa::types::put_string_field(1u32, &self.module, buf);
}
if let ::core::option::Option::Some(ref v) = self.query {
match v {
super::__buffa::oneof::module::block_filter::Query::QueryString(
x,
) => {
::buffa::types::put_string_field(2u32, x, buf);
}
super::__buffa::oneof::module::block_filter::Query::QueryFromParams(
x,
) => {
::buffa::types::put_len_delimited_header(
3u32,
u64::from(__cache.consume_next()),
buf,
);
x.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_string(&mut self.module, buf)?;
}
2u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::LengthDelimited,
)?;
self.query = ::core::option::Option::Some(
super::__buffa::oneof::module::block_filter::Query::QueryString(
::buffa::types::decode_string(buf)?,
),
);
}
3u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::LengthDelimited,
)?;
if let ::core::option::Option::Some(
super::__buffa::oneof::module::block_filter::Query::QueryFromParams(
ref mut existing,
),
) = self.query
{
::buffa::Message::merge_length_delimited(
&mut **existing,
buf,
ctx,
)?;
} else {
let mut val = ::core::default::Default::default();
::buffa::Message::merge_length_delimited(&mut val, buf, ctx)?;
self.query = ::core::option::Option::Some(
super::__buffa::oneof::module::block_filter::Query::QueryFromParams(
::buffa::alloc::boxed::Box::new(val),
),
);
}
}
_ => {
::buffa::encoding::skip_field_depth(tag, buf, ctx.depth())?;
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.module.clear();
self.query = ::core::option::Option::None;
}
}
pub mod block_filter {
#[allow(unused_imports)]
use super::*;
#[doc(inline)]
pub use super::super::__buffa::oneof::module::block_filter::Query;
#[doc(inline)]
pub use super::super::__buffa::view::oneof::module::block_filter::Query as QueryView;
}
#[derive(Clone, PartialEq, Default)]
pub struct QueryFromParams {}
impl ::core::fmt::Debug for QueryFromParams {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("QueryFromParams").finish()
}
}
impl QueryFromParams {
pub const TYPE_URL: &'static str = "type.googleapis.com/sf.substreams.v1.Module.QueryFromParams";
}
::buffa::impl_default_instance!(QueryFromParams);
impl ::buffa::MessageName for QueryFromParams {
const PACKAGE: &'static str = "sf.substreams.v1";
const NAME: &'static str = "Module.QueryFromParams";
const FULL_NAME: &'static str = "sf.substreams.v1.Module.QueryFromParams";
const TYPE_URL: &'static str = "type.googleapis.com/sf.substreams.v1.Module.QueryFromParams";
}
impl ::buffa::Message for QueryFromParams {
#[allow(clippy::let_and_return)]
fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
let size = 0u64;
::buffa::saturate_size(size)
}
fn write_to(
&self,
_cache: &mut ::buffa::SizeCache,
_buf: &mut impl ::buffa::EncodeSink,
) {
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
}
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() {
_ => {
::buffa::encoding::skip_field_depth(tag, buf, ctx.depth())?;
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {}
}
#[derive(Clone, PartialEq, Default)]
pub struct KindMap {
pub output_type: ::buffa::alloc::string::String,
}
impl ::core::fmt::Debug for KindMap {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("KindMap").field("output_type", &self.output_type).finish()
}
}
impl KindMap {
pub const TYPE_URL: &'static str = "type.googleapis.com/sf.substreams.v1.Module.KindMap";
}
::buffa::impl_default_instance!(KindMap);
impl ::buffa::MessageName for KindMap {
const PACKAGE: &'static str = "sf.substreams.v1";
const NAME: &'static str = "Module.KindMap";
const FULL_NAME: &'static str = "sf.substreams.v1.Module.KindMap";
const TYPE_URL: &'static str = "type.googleapis.com/sf.substreams.v1.Module.KindMap";
}
impl ::buffa::Message for KindMap {
#[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.output_type.is_empty() {
size
+= 1u64
+ ::buffa::types::string_encoded_len(&self.output_type) 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.output_type.is_empty() {
::buffa::types::put_string_field(1u32, &self.output_type, 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_string(&mut self.output_type, buf)?;
}
_ => {
::buffa::encoding::skip_field_depth(tag, buf, ctx.depth())?;
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.output_type.clear();
}
}
#[derive(Clone, PartialEq, Default)]
pub struct KindStore {
pub update_policy: ::buffa::EnumValue<super::module::kind_store::UpdatePolicy>,
pub value_type: ::buffa::alloc::string::String,
}
impl ::core::fmt::Debug for KindStore {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("KindStore")
.field("update_policy", &self.update_policy)
.field("value_type", &self.value_type)
.finish()
}
}
impl KindStore {
pub const TYPE_URL: &'static str = "type.googleapis.com/sf.substreams.v1.Module.KindStore";
}
::buffa::impl_default_instance!(KindStore);
impl ::buffa::MessageName for KindStore {
const PACKAGE: &'static str = "sf.substreams.v1";
const NAME: &'static str = "Module.KindStore";
const FULL_NAME: &'static str = "sf.substreams.v1.Module.KindStore";
const TYPE_URL: &'static str = "type.googleapis.com/sf.substreams.v1.Module.KindStore";
}
impl ::buffa::Message for KindStore {
#[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;
{
let val = self.update_policy.to_i32();
if val != 0 {
size += 1u64 + ::buffa::types::int32_encoded_len(val) as u64;
}
}
if !self.value_type.is_empty() {
size
+= 1u64
+ ::buffa::types::string_encoded_len(&self.value_type) 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 _;
{
let val = self.update_policy.to_i32();
if val != 0 {
::buffa::types::put_int32_field(1u32, val, buf);
}
}
if !self.value_type.is_empty() {
::buffa::types::put_string_field(2u32, &self.value_type, 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.update_policy = ::buffa::EnumValue::from(
::buffa::types::decode_int32(buf)?,
);
}
2u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::LengthDelimited,
)?;
::buffa::types::merge_string(&mut self.value_type, buf)?;
}
_ => {
::buffa::encoding::skip_field_depth(tag, buf, ctx.depth())?;
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.update_policy = ::buffa::EnumValue::from(0);
self.value_type.clear();
}
}
pub mod kind_store {
#[allow(unused_imports)]
use super::*;
#[allow(non_camel_case_types)]
#[derive(Clone, Copy, PartialEq, Eq, Hash, Debug)]
#[repr(i32)]
pub enum UpdatePolicy {
UPDATE_POLICY_UNSET = 0i32,
UPDATE_POLICY_SET = 1i32,
UPDATE_POLICY_SET_IF_NOT_EXISTS = 2i32,
UPDATE_POLICY_ADD = 3i32,
UPDATE_POLICY_MIN = 4i32,
UPDATE_POLICY_MAX = 5i32,
UPDATE_POLICY_APPEND = 6i32,
UPDATE_POLICY_SET_SUM = 7i32,
}
impl UpdatePolicy {
#[allow(non_upper_case_globals)]
pub const Unset: Self = Self::UPDATE_POLICY_UNSET;
#[allow(non_upper_case_globals)]
pub const Set: Self = Self::UPDATE_POLICY_SET;
#[allow(non_upper_case_globals)]
pub const SetIfNotExists: Self = Self::UPDATE_POLICY_SET_IF_NOT_EXISTS;
#[allow(non_upper_case_globals)]
pub const Add: Self = Self::UPDATE_POLICY_ADD;
#[allow(non_upper_case_globals)]
pub const Min: Self = Self::UPDATE_POLICY_MIN;
#[allow(non_upper_case_globals)]
pub const Max: Self = Self::UPDATE_POLICY_MAX;
#[allow(non_upper_case_globals)]
pub const Append: Self = Self::UPDATE_POLICY_APPEND;
#[allow(non_upper_case_globals)]
pub const SetSum: Self = Self::UPDATE_POLICY_SET_SUM;
}
impl ::core::default::Default for UpdatePolicy {
fn default() -> Self {
Self::UPDATE_POLICY_UNSET
}
}
impl ::buffa::Enumeration for UpdatePolicy {
fn from_i32(value: i32) -> ::core::option::Option<Self> {
match value {
0i32 => ::core::option::Option::Some(Self::UPDATE_POLICY_UNSET),
1i32 => ::core::option::Option::Some(Self::UPDATE_POLICY_SET),
2i32 => {
::core::option::Option::Some(
Self::UPDATE_POLICY_SET_IF_NOT_EXISTS,
)
}
3i32 => ::core::option::Option::Some(Self::UPDATE_POLICY_ADD),
4i32 => ::core::option::Option::Some(Self::UPDATE_POLICY_MIN),
5i32 => ::core::option::Option::Some(Self::UPDATE_POLICY_MAX),
6i32 => ::core::option::Option::Some(Self::UPDATE_POLICY_APPEND),
7i32 => ::core::option::Option::Some(Self::UPDATE_POLICY_SET_SUM),
_ => ::core::option::Option::None,
}
}
fn to_i32(&self) -> i32 {
*self as i32
}
fn proto_name(&self) -> &'static str {
match self {
Self::UPDATE_POLICY_UNSET => "UPDATE_POLICY_UNSET",
Self::UPDATE_POLICY_SET => "UPDATE_POLICY_SET",
Self::UPDATE_POLICY_SET_IF_NOT_EXISTS => {
"UPDATE_POLICY_SET_IF_NOT_EXISTS"
}
Self::UPDATE_POLICY_ADD => "UPDATE_POLICY_ADD",
Self::UPDATE_POLICY_MIN => "UPDATE_POLICY_MIN",
Self::UPDATE_POLICY_MAX => "UPDATE_POLICY_MAX",
Self::UPDATE_POLICY_APPEND => "UPDATE_POLICY_APPEND",
Self::UPDATE_POLICY_SET_SUM => "UPDATE_POLICY_SET_SUM",
}
}
fn from_proto_name(name: &str) -> ::core::option::Option<Self> {
match name {
"UPDATE_POLICY_UNSET" => {
::core::option::Option::Some(Self::UPDATE_POLICY_UNSET)
}
"UPDATE_POLICY_SET" => {
::core::option::Option::Some(Self::UPDATE_POLICY_SET)
}
"UPDATE_POLICY_SET_IF_NOT_EXISTS" => {
::core::option::Option::Some(
Self::UPDATE_POLICY_SET_IF_NOT_EXISTS,
)
}
"UPDATE_POLICY_ADD" => {
::core::option::Option::Some(Self::UPDATE_POLICY_ADD)
}
"UPDATE_POLICY_MIN" => {
::core::option::Option::Some(Self::UPDATE_POLICY_MIN)
}
"UPDATE_POLICY_MAX" => {
::core::option::Option::Some(Self::UPDATE_POLICY_MAX)
}
"UPDATE_POLICY_APPEND" => {
::core::option::Option::Some(Self::UPDATE_POLICY_APPEND)
}
"UPDATE_POLICY_SET_SUM" => {
::core::option::Option::Some(Self::UPDATE_POLICY_SET_SUM)
}
_ => ::core::option::Option::None,
}
}
fn values() -> &'static [Self] {
&[
Self::UPDATE_POLICY_UNSET,
Self::UPDATE_POLICY_SET,
Self::UPDATE_POLICY_SET_IF_NOT_EXISTS,
Self::UPDATE_POLICY_ADD,
Self::UPDATE_POLICY_MIN,
Self::UPDATE_POLICY_MAX,
Self::UPDATE_POLICY_APPEND,
Self::UPDATE_POLICY_SET_SUM,
]
}
}
}
#[derive(Clone, PartialEq, Default)]
pub struct KindBlockIndex {
pub output_type: ::buffa::alloc::string::String,
}
impl ::core::fmt::Debug for KindBlockIndex {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("KindBlockIndex")
.field("output_type", &self.output_type)
.finish()
}
}
impl KindBlockIndex {
pub const TYPE_URL: &'static str = "type.googleapis.com/sf.substreams.v1.Module.KindBlockIndex";
}
::buffa::impl_default_instance!(KindBlockIndex);
impl ::buffa::MessageName for KindBlockIndex {
const PACKAGE: &'static str = "sf.substreams.v1";
const NAME: &'static str = "Module.KindBlockIndex";
const FULL_NAME: &'static str = "sf.substreams.v1.Module.KindBlockIndex";
const TYPE_URL: &'static str = "type.googleapis.com/sf.substreams.v1.Module.KindBlockIndex";
}
impl ::buffa::Message for KindBlockIndex {
#[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.output_type.is_empty() {
size
+= 1u64
+ ::buffa::types::string_encoded_len(&self.output_type) 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.output_type.is_empty() {
::buffa::types::put_string_field(1u32, &self.output_type, 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_string(&mut self.output_type, buf)?;
}
_ => {
::buffa::encoding::skip_field_depth(tag, buf, ctx.depth())?;
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.output_type.clear();
}
}
#[derive(Clone, PartialEq, Default)]
pub struct FoundationalStore {
pub identifier: ::buffa::alloc::string::String,
}
impl ::core::fmt::Debug for FoundationalStore {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("FoundationalStore")
.field("identifier", &self.identifier)
.finish()
}
}
impl FoundationalStore {
pub const TYPE_URL: &'static str = "type.googleapis.com/sf.substreams.v1.Module.FoundationalStore";
}
::buffa::impl_default_instance!(FoundationalStore);
impl ::buffa::MessageName for FoundationalStore {
const PACKAGE: &'static str = "sf.substreams.v1";
const NAME: &'static str = "Module.FoundationalStore";
const FULL_NAME: &'static str = "sf.substreams.v1.Module.FoundationalStore";
const TYPE_URL: &'static str = "type.googleapis.com/sf.substreams.v1.Module.FoundationalStore";
}
impl ::buffa::Message for FoundationalStore {
#[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.identifier.is_empty() {
size
+= 1u64
+ ::buffa::types::string_encoded_len(&self.identifier) 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.identifier.is_empty() {
::buffa::types::put_string_field(1u32, &self.identifier, 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_string(&mut self.identifier, buf)?;
}
_ => {
::buffa::encoding::skip_field_depth(tag, buf, ctx.depth())?;
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.identifier.clear();
}
}
#[derive(Clone, PartialEq, Default)]
pub struct Input {
pub input: ::core::option::Option<super::__buffa::oneof::module::input::Input>,
}
impl ::core::fmt::Debug for Input {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("Input").field("input", &self.input).finish()
}
}
impl Input {
pub const TYPE_URL: &'static str = "type.googleapis.com/sf.substreams.v1.Module.Input";
}
::buffa::impl_default_instance!(Input);
impl ::buffa::MessageName for Input {
const PACKAGE: &'static str = "sf.substreams.v1";
const NAME: &'static str = "Module.Input";
const FULL_NAME: &'static str = "sf.substreams.v1.Module.Input";
const TYPE_URL: &'static str = "type.googleapis.com/sf.substreams.v1.Module.Input";
}
impl ::buffa::Message for Input {
#[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.input {
match v {
super::__buffa::oneof::module::input::Input::Source(x) => {
let __slot = __cache.reserve();
let inner = x.compute_size(__cache);
__cache.set(__slot, inner);
size
+= 1u64 + ::buffa::encoding::varint_len(inner as u64) as u64
+ inner as u64;
}
super::__buffa::oneof::module::input::Input::Map(x) => {
let __slot = __cache.reserve();
let inner = x.compute_size(__cache);
__cache.set(__slot, inner);
size
+= 1u64 + ::buffa::encoding::varint_len(inner as u64) as u64
+ inner as u64;
}
super::__buffa::oneof::module::input::Input::Store(x) => {
let __slot = __cache.reserve();
let inner = x.compute_size(__cache);
__cache.set(__slot, inner);
size
+= 1u64 + ::buffa::encoding::varint_len(inner as u64) as u64
+ inner as u64;
}
super::__buffa::oneof::module::input::Input::Params(x) => {
let __slot = __cache.reserve();
let inner = x.compute_size(__cache);
__cache.set(__slot, inner);
size
+= 1u64 + ::buffa::encoding::varint_len(inner as u64) as u64
+ inner as u64;
}
super::__buffa::oneof::module::input::Input::FoundationalStore(
x,
) => {
let __slot = __cache.reserve();
let inner = x.compute_size(__cache);
__cache.set(__slot, inner);
size
+= 1u64 + ::buffa::encoding::varint_len(inner as u64) as u64
+ inner 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.input {
match v {
super::__buffa::oneof::module::input::Input::Source(x) => {
::buffa::types::put_len_delimited_header(
1u32,
u64::from(__cache.consume_next()),
buf,
);
x.write_to(__cache, buf);
}
super::__buffa::oneof::module::input::Input::Map(x) => {
::buffa::types::put_len_delimited_header(
2u32,
u64::from(__cache.consume_next()),
buf,
);
x.write_to(__cache, buf);
}
super::__buffa::oneof::module::input::Input::Store(x) => {
::buffa::types::put_len_delimited_header(
3u32,
u64::from(__cache.consume_next()),
buf,
);
x.write_to(__cache, buf);
}
super::__buffa::oneof::module::input::Input::Params(x) => {
::buffa::types::put_len_delimited_header(
4u32,
u64::from(__cache.consume_next()),
buf,
);
x.write_to(__cache, buf);
}
super::__buffa::oneof::module::input::Input::FoundationalStore(
x,
) => {
::buffa::types::put_len_delimited_header(
5u32,
u64::from(__cache.consume_next()),
buf,
);
x.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,
)?;
if let ::core::option::Option::Some(
super::__buffa::oneof::module::input::Input::Source(
ref mut existing,
),
) = self.input
{
::buffa::Message::merge_length_delimited(
&mut **existing,
buf,
ctx,
)?;
} else {
let mut val = ::core::default::Default::default();
::buffa::Message::merge_length_delimited(&mut val, buf, ctx)?;
self.input = ::core::option::Option::Some(
super::__buffa::oneof::module::input::Input::Source(
::buffa::alloc::boxed::Box::new(val),
),
);
}
}
2u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::LengthDelimited,
)?;
if let ::core::option::Option::Some(
super::__buffa::oneof::module::input::Input::Map(
ref mut existing,
),
) = self.input
{
::buffa::Message::merge_length_delimited(
&mut **existing,
buf,
ctx,
)?;
} else {
let mut val = ::core::default::Default::default();
::buffa::Message::merge_length_delimited(&mut val, buf, ctx)?;
self.input = ::core::option::Option::Some(
super::__buffa::oneof::module::input::Input::Map(
::buffa::alloc::boxed::Box::new(val),
),
);
}
}
3u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::LengthDelimited,
)?;
if let ::core::option::Option::Some(
super::__buffa::oneof::module::input::Input::Store(
ref mut existing,
),
) = self.input
{
::buffa::Message::merge_length_delimited(
&mut **existing,
buf,
ctx,
)?;
} else {
let mut val = ::core::default::Default::default();
::buffa::Message::merge_length_delimited(&mut val, buf, ctx)?;
self.input = ::core::option::Option::Some(
super::__buffa::oneof::module::input::Input::Store(
::buffa::alloc::boxed::Box::new(val),
),
);
}
}
4u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::LengthDelimited,
)?;
if let ::core::option::Option::Some(
super::__buffa::oneof::module::input::Input::Params(
ref mut existing,
),
) = self.input
{
::buffa::Message::merge_length_delimited(
&mut **existing,
buf,
ctx,
)?;
} else {
let mut val = ::core::default::Default::default();
::buffa::Message::merge_length_delimited(&mut val, buf, ctx)?;
self.input = ::core::option::Option::Some(
super::__buffa::oneof::module::input::Input::Params(
::buffa::alloc::boxed::Box::new(val),
),
);
}
}
5u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::LengthDelimited,
)?;
if let ::core::option::Option::Some(
super::__buffa::oneof::module::input::Input::FoundationalStore(
ref mut existing,
),
) = self.input
{
::buffa::Message::merge_length_delimited(
&mut **existing,
buf,
ctx,
)?;
} else {
let mut val = ::core::default::Default::default();
::buffa::Message::merge_length_delimited(&mut val, buf, ctx)?;
self.input = ::core::option::Option::Some(
super::__buffa::oneof::module::input::Input::FoundationalStore(
::buffa::alloc::boxed::Box::new(val),
),
);
}
}
_ => {
::buffa::encoding::skip_field_depth(tag, buf, ctx.depth())?;
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.input = ::core::option::Option::None;
}
}
pub mod input {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, PartialEq, Default)]
pub struct Source {
pub r#type: ::buffa::alloc::string::String,
}
impl ::core::fmt::Debug for Source {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("Source").field("type", &self.r#type).finish()
}
}
impl Source {
pub const TYPE_URL: &'static str = "type.googleapis.com/sf.substreams.v1.Module.Input.Source";
}
::buffa::impl_default_instance!(Source);
impl ::buffa::MessageName for Source {
const PACKAGE: &'static str = "sf.substreams.v1";
const NAME: &'static str = "Module.Input.Source";
const FULL_NAME: &'static str = "sf.substreams.v1.Module.Input.Source";
const TYPE_URL: &'static str = "type.googleapis.com/sf.substreams.v1.Module.Input.Source";
}
impl ::buffa::Message for Source {
#[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.r#type.is_empty() {
size
+= 1u64
+ ::buffa::types::string_encoded_len(&self.r#type) 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.r#type.is_empty() {
::buffa::types::put_string_field(1u32, &self.r#type, 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_string(&mut self.r#type, buf)?;
}
_ => {
::buffa::encoding::skip_field_depth(tag, buf, ctx.depth())?;
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.r#type.clear();
}
}
#[derive(Clone, PartialEq, Default)]
pub struct Map {
pub module_name: ::buffa::alloc::string::String,
}
impl ::core::fmt::Debug for Map {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("Map").field("module_name", &self.module_name).finish()
}
}
impl Map {
pub const TYPE_URL: &'static str = "type.googleapis.com/sf.substreams.v1.Module.Input.Map";
}
::buffa::impl_default_instance!(Map);
impl ::buffa::MessageName for Map {
const PACKAGE: &'static str = "sf.substreams.v1";
const NAME: &'static str = "Module.Input.Map";
const FULL_NAME: &'static str = "sf.substreams.v1.Module.Input.Map";
const TYPE_URL: &'static str = "type.googleapis.com/sf.substreams.v1.Module.Input.Map";
}
impl ::buffa::Message for Map {
#[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.module_name.is_empty() {
size
+= 1u64
+ ::buffa::types::string_encoded_len(&self.module_name)
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.module_name.is_empty() {
::buffa::types::put_string_field(1u32, &self.module_name, 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_string(&mut self.module_name, buf)?;
}
_ => {
::buffa::encoding::skip_field_depth(tag, buf, ctx.depth())?;
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.module_name.clear();
}
}
#[derive(Clone, PartialEq, Default)]
pub struct Store {
pub module_name: ::buffa::alloc::string::String,
pub mode: ::buffa::EnumValue<super::super::module::input::store::Mode>,
}
impl ::core::fmt::Debug for Store {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("Store")
.field("module_name", &self.module_name)
.field("mode", &self.mode)
.finish()
}
}
impl Store {
pub const TYPE_URL: &'static str = "type.googleapis.com/sf.substreams.v1.Module.Input.Store";
}
::buffa::impl_default_instance!(Store);
impl ::buffa::MessageName for Store {
const PACKAGE: &'static str = "sf.substreams.v1";
const NAME: &'static str = "Module.Input.Store";
const FULL_NAME: &'static str = "sf.substreams.v1.Module.Input.Store";
const TYPE_URL: &'static str = "type.googleapis.com/sf.substreams.v1.Module.Input.Store";
}
impl ::buffa::Message for Store {
#[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.module_name.is_empty() {
size
+= 1u64
+ ::buffa::types::string_encoded_len(&self.module_name)
as u64;
}
{
let val = self.mode.to_i32();
if val != 0 {
size += 1u64 + ::buffa::types::int32_encoded_len(val) 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.module_name.is_empty() {
::buffa::types::put_string_field(1u32, &self.module_name, buf);
}
{
let val = self.mode.to_i32();
if val != 0 {
::buffa::types::put_int32_field(2u32, val, 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_string(&mut self.module_name, buf)?;
}
2u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::Varint,
)?;
self.mode = ::buffa::EnumValue::from(
::buffa::types::decode_int32(buf)?,
);
}
_ => {
::buffa::encoding::skip_field_depth(tag, buf, ctx.depth())?;
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.module_name.clear();
self.mode = ::buffa::EnumValue::from(0);
}
}
pub mod store {
#[allow(unused_imports)]
use super::*;
#[allow(non_camel_case_types)]
#[derive(Clone, Copy, PartialEq, Eq, Hash, Debug)]
#[repr(i32)]
pub enum Mode {
UNSET = 0i32,
GET = 1i32,
DELTAS = 2i32,
}
impl Mode {
#[allow(non_upper_case_globals)]
pub const Unset: Self = Self::UNSET;
#[allow(non_upper_case_globals)]
pub const Get: Self = Self::GET;
#[allow(non_upper_case_globals)]
pub const Deltas: Self = Self::DELTAS;
}
impl ::core::default::Default for Mode {
fn default() -> Self {
Self::UNSET
}
}
impl ::buffa::Enumeration for Mode {
fn from_i32(value: i32) -> ::core::option::Option<Self> {
match value {
0i32 => ::core::option::Option::Some(Self::UNSET),
1i32 => ::core::option::Option::Some(Self::GET),
2i32 => ::core::option::Option::Some(Self::DELTAS),
_ => ::core::option::Option::None,
}
}
fn to_i32(&self) -> i32 {
*self as i32
}
fn proto_name(&self) -> &'static str {
match self {
Self::UNSET => "UNSET",
Self::GET => "GET",
Self::DELTAS => "DELTAS",
}
}
fn from_proto_name(name: &str) -> ::core::option::Option<Self> {
match name {
"UNSET" => ::core::option::Option::Some(Self::UNSET),
"GET" => ::core::option::Option::Some(Self::GET),
"DELTAS" => ::core::option::Option::Some(Self::DELTAS),
_ => ::core::option::Option::None,
}
}
fn values() -> &'static [Self] {
&[Self::UNSET, Self::GET, Self::DELTAS]
}
}
}
#[derive(Clone, PartialEq, Default)]
pub struct Params {
pub value: ::buffa::alloc::string::String,
}
impl ::core::fmt::Debug for Params {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("Params").field("value", &self.value).finish()
}
}
impl Params {
pub const TYPE_URL: &'static str = "type.googleapis.com/sf.substreams.v1.Module.Input.Params";
}
::buffa::impl_default_instance!(Params);
impl ::buffa::MessageName for Params {
const PACKAGE: &'static str = "sf.substreams.v1";
const NAME: &'static str = "Module.Input.Params";
const FULL_NAME: &'static str = "sf.substreams.v1.Module.Input.Params";
const TYPE_URL: &'static str = "type.googleapis.com/sf.substreams.v1.Module.Input.Params";
}
impl ::buffa::Message for Params {
#[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.value.is_empty() {
size
+= 1u64 + ::buffa::types::string_encoded_len(&self.value) 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.value.is_empty() {
::buffa::types::put_string_field(1u32, &self.value, 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_string(&mut self.value, buf)?;
}
_ => {
::buffa::encoding::skip_field_depth(tag, buf, ctx.depth())?;
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.value.clear();
}
}
#[doc(inline)]
pub use super::super::__buffa::oneof::module::input::Input;
#[doc(inline)]
pub use super::super::__buffa::view::module::input::SourceView;
#[doc(inline)]
pub use super::super::__buffa::view::module::input::SourceOwnedView;
#[doc(inline)]
pub use super::super::__buffa::lazy_view::module::input::SourceLazyView;
#[doc(inline)]
pub use super::super::__buffa::view::module::input::MapView;
#[doc(inline)]
pub use super::super::__buffa::view::module::input::MapOwnedView;
#[doc(inline)]
pub use super::super::__buffa::lazy_view::module::input::MapLazyView;
#[doc(inline)]
pub use super::super::__buffa::view::module::input::StoreView;
#[doc(inline)]
pub use super::super::__buffa::view::module::input::StoreOwnedView;
#[doc(inline)]
pub use super::super::__buffa::lazy_view::module::input::StoreLazyView;
#[doc(inline)]
pub use super::super::__buffa::view::module::input::ParamsView;
#[doc(inline)]
pub use super::super::__buffa::view::module::input::ParamsOwnedView;
#[doc(inline)]
pub use super::super::__buffa::lazy_view::module::input::ParamsLazyView;
#[doc(inline)]
pub use super::super::__buffa::view::oneof::module::input::Input as InputView;
}
#[derive(Clone, PartialEq, Default)]
pub struct Output {
pub r#type: ::buffa::alloc::string::String,
}
impl ::core::fmt::Debug for Output {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("Output").field("type", &self.r#type).finish()
}
}
impl Output {
pub const TYPE_URL: &'static str = "type.googleapis.com/sf.substreams.v1.Module.Output";
}
::buffa::impl_default_instance!(Output);
impl ::buffa::MessageName for Output {
const PACKAGE: &'static str = "sf.substreams.v1";
const NAME: &'static str = "Module.Output";
const FULL_NAME: &'static str = "sf.substreams.v1.Module.Output";
const TYPE_URL: &'static str = "type.googleapis.com/sf.substreams.v1.Module.Output";
}
impl ::buffa::Message for Output {
#[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.r#type.is_empty() {
size += 1u64 + ::buffa::types::string_encoded_len(&self.r#type) 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.r#type.is_empty() {
::buffa::types::put_string_field(1u32, &self.r#type, 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_string(&mut self.r#type, buf)?;
}
_ => {
::buffa::encoding::skip_field_depth(tag, buf, ctx.depth())?;
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.r#type.clear();
}
}
#[doc(inline)]
pub use super::__buffa::oneof::module::Kind;
#[doc(inline)]
pub use super::__buffa::view::module::BlockFilterView;
#[doc(inline)]
pub use super::__buffa::view::module::BlockFilterOwnedView;
#[doc(inline)]
pub use super::__buffa::lazy_view::module::BlockFilterLazyView;
#[doc(inline)]
pub use super::__buffa::view::module::QueryFromParamsView;
#[doc(inline)]
pub use super::__buffa::view::module::QueryFromParamsOwnedView;
#[doc(inline)]
pub use super::__buffa::lazy_view::module::QueryFromParamsLazyView;
#[doc(inline)]
pub use super::__buffa::view::module::KindMapView;
#[doc(inline)]
pub use super::__buffa::view::module::KindMapOwnedView;
#[doc(inline)]
pub use super::__buffa::lazy_view::module::KindMapLazyView;
#[doc(inline)]
pub use super::__buffa::view::module::KindStoreView;
#[doc(inline)]
pub use super::__buffa::view::module::KindStoreOwnedView;
#[doc(inline)]
pub use super::__buffa::lazy_view::module::KindStoreLazyView;
#[doc(inline)]
pub use super::__buffa::view::module::KindBlockIndexView;
#[doc(inline)]
pub use super::__buffa::view::module::KindBlockIndexOwnedView;
#[doc(inline)]
pub use super::__buffa::lazy_view::module::KindBlockIndexLazyView;
#[doc(inline)]
pub use super::__buffa::view::module::FoundationalStoreView;
#[doc(inline)]
pub use super::__buffa::view::module::FoundationalStoreOwnedView;
#[doc(inline)]
pub use super::__buffa::lazy_view::module::FoundationalStoreLazyView;
#[doc(inline)]
pub use super::__buffa::view::module::InputView;
#[doc(inline)]
pub use super::__buffa::view::module::InputOwnedView;
#[doc(inline)]
pub use super::__buffa::lazy_view::module::InputLazyView;
#[doc(inline)]
pub use super::__buffa::view::module::OutputView;
#[doc(inline)]
pub use super::__buffa::view::module::OutputOwnedView;
#[doc(inline)]
pub use super::__buffa::lazy_view::module::OutputLazyView;
#[doc(inline)]
pub use super::__buffa::view::oneof::module::Kind as KindView;
}