// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// 	protoc-gen-go v1.36.6
// 	protoc        (unknown)
// source: io/writer/writer.proto

package writer

import (
	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
	reflect "reflect"
	sync "sync"
	unsafe "unsafe"
)

const (
	// Verify that this generated code is sufficiently up-to-date.
	_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
	// Verify that runtime/protoimpl is sufficiently up-to-date.
	_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)

type WriteRequest struct {
	state protoimpl.MessageState `protogen:"open.v1"`
	// payload is the write request in bytes
	Payload       []byte `protobuf:"bytes,1,opt,name=payload,proto3" json:"payload,omitempty"`
	unknownFields protoimpl.UnknownFields
	sizeCache     protoimpl.SizeCache
}

func (x *WriteRequest) Reset() {
	*x = WriteRequest{}
	mi := &file_io_writer_writer_proto_msgTypes[0]
	ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
	ms.StoreMessageInfo(mi)
}

func (x *WriteRequest) String() string {
	return protoimpl.X.MessageStringOf(x)
}

func (*WriteRequest) ProtoMessage() {}

func (x *WriteRequest) ProtoReflect() protoreflect.Message {
	mi := &file_io_writer_writer_proto_msgTypes[0]
	if x != nil {
		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
		if ms.LoadMessageInfo() == nil {
			ms.StoreMessageInfo(mi)
		}
		return ms
	}
	return mi.MessageOf(x)
}

// Deprecated: Use WriteRequest.ProtoReflect.Descriptor instead.
func (*WriteRequest) Descriptor() ([]byte, []int) {
	return file_io_writer_writer_proto_rawDescGZIP(), []int{0}
}

func (x *WriteRequest) GetPayload() []byte {
	if x != nil {
		return x.Payload
	}
	return nil
}

type WriteResponse struct {
	state protoimpl.MessageState `protogen:"open.v1"`
	// written is the length of payload in bytes
	Written int32 `protobuf:"varint,1,opt,name=written,proto3" json:"written,omitempty"`
	// error is an error message
	Error         *string `protobuf:"bytes,2,opt,name=error,proto3,oneof" json:"error,omitempty"`
	unknownFields protoimpl.UnknownFields
	sizeCache     protoimpl.SizeCache
}

func (x *WriteResponse) Reset() {
	*x = WriteResponse{}
	mi := &file_io_writer_writer_proto_msgTypes[1]
	ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
	ms.StoreMessageInfo(mi)
}

func (x *WriteResponse) String() string {
	return protoimpl.X.MessageStringOf(x)
}

func (*WriteResponse) ProtoMessage() {}

func (x *WriteResponse) ProtoReflect() protoreflect.Message {
	mi := &file_io_writer_writer_proto_msgTypes[1]
	if x != nil {
		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
		if ms.LoadMessageInfo() == nil {
			ms.StoreMessageInfo(mi)
		}
		return ms
	}
	return mi.MessageOf(x)
}

// Deprecated: Use WriteResponse.ProtoReflect.Descriptor instead.
func (*WriteResponse) Descriptor() ([]byte, []int) {
	return file_io_writer_writer_proto_rawDescGZIP(), []int{1}
}

func (x *WriteResponse) GetWritten() int32 {
	if x != nil {
		return x.Written
	}
	return 0
}

func (x *WriteResponse) GetError() string {
	if x != nil && x.Error != nil {
		return *x.Error
	}
	return ""
}

var File_io_writer_writer_proto protoreflect.FileDescriptor

const file_io_writer_writer_proto_rawDesc = "" +
	"\n" +
	"\x16io/writer/writer.proto\x12\tio.writer\"(\n" +
	"\fWriteRequest\x12\x18\n" +
	"\apayload\x18\x01 \x01(\fR\apayload\"N\n" +
	"\rWriteResponse\x12\x18\n" +
	"\awritten\x18\x01 \x01(\x05R\awritten\x12\x19\n" +
	"\x05error\x18\x02 \x01(\tH\x00R\x05error\x88\x01\x01B\b\n" +
	"\x06_error2D\n" +
	"\x06Writer\x12:\n" +
	"\x05Write\x12\x17.io.writer.WriteRequest\x1a\x18.io.writer.WriteResponseB4Z2github.com/ava-labs/avalanchego/proto/pb/io/writerb\x06proto3"

var (
	file_io_writer_writer_proto_rawDescOnce sync.Once
	file_io_writer_writer_proto_rawDescData []byte
)

func file_io_writer_writer_proto_rawDescGZIP() []byte {
	file_io_writer_writer_proto_rawDescOnce.Do(func() {
		file_io_writer_writer_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_io_writer_writer_proto_rawDesc), len(file_io_writer_writer_proto_rawDesc)))
	})
	return file_io_writer_writer_proto_rawDescData
}

var file_io_writer_writer_proto_msgTypes = make([]protoimpl.MessageInfo, 2)
var file_io_writer_writer_proto_goTypes = []any{
	(*WriteRequest)(nil),  // 0: io.writer.WriteRequest
	(*WriteResponse)(nil), // 1: io.writer.WriteResponse
}
var file_io_writer_writer_proto_depIdxs = []int32{
	0, // 0: io.writer.Writer.Write:input_type -> io.writer.WriteRequest
	1, // 1: io.writer.Writer.Write:output_type -> io.writer.WriteResponse
	1, // [1:2] is the sub-list for method output_type
	0, // [0:1] is the sub-list for method input_type
	0, // [0:0] is the sub-list for extension type_name
	0, // [0:0] is the sub-list for extension extendee
	0, // [0:0] is the sub-list for field type_name
}

func init() { file_io_writer_writer_proto_init() }
func file_io_writer_writer_proto_init() {
	if File_io_writer_writer_proto != nil {
		return
	}
	file_io_writer_writer_proto_msgTypes[1].OneofWrappers = []any{}
	type x struct{}
	out := protoimpl.TypeBuilder{
		File: protoimpl.DescBuilder{
			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
			RawDescriptor: unsafe.Slice(unsafe.StringData(file_io_writer_writer_proto_rawDesc), len(file_io_writer_writer_proto_rawDesc)),
			NumEnums:      0,
			NumMessages:   2,
			NumExtensions: 0,
			NumServices:   1,
		},
		GoTypes:           file_io_writer_writer_proto_goTypes,
		DependencyIndexes: file_io_writer_writer_proto_depIdxs,
		MessageInfos:      file_io_writer_writer_proto_msgTypes,
	}.Build()
	File_io_writer_writer_proto = out.File
	file_io_writer_writer_proto_goTypes = nil
	file_io_writer_writer_proto_depIdxs = nil
}
