// Code generated by gtrace. DO NOT EDIT.

package gtrace

import (
	"context"

	"github.com/ydb-platform/ydb-go-genproto/protos/Ydb_Topic"
	"github.com/ydb-platform/ydb-go-sdk/v3/trace"
)

// topicComposeOptions is a holder of options
type topicComposeOptions struct {
	panicCallback func(e interface{})
}

// TopicOption specified Topic compose option
// Internals: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#internals
type TopicComposeOption func(o *topicComposeOptions)

// WithTopicPanicCallback specified behavior on panic
// Internals: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#internals
func WithTopicPanicCallback(cb func(e interface{})) TopicComposeOption {
	return func(o *topicComposeOptions) {
		o.panicCallback = cb
	}
}

// Compose returns a new Topic which has functional fields composed both from lhs and rhs.
// Internals: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#internals
func Compose(lhs *trace.Topic, rhs *trace.Topic, opts ...TopicComposeOption) *trace.Topic {
	if lhs == nil {
		return rhs
	}
	var ret trace.Topic
	options := topicComposeOptions{}
	for _, opt := range opts {
		if opt != nil {
			opt(&options)
		}
	}
	{
		h1 := lhs.OnReaderStart
		h2 := rhs.OnReaderStart
		ret.OnReaderStart = func(info trace.TopicReaderStartInfo) {
			if options.panicCallback != nil {
				defer func() {
					if e := recover(); e != nil {
						options.panicCallback(e)
					}
				}()
			}
			if h1 != nil {
				h1(info)
			}
			if h2 != nil {
				h2(info)
			}
		}
	}
	{
		h1 := lhs.OnReaderReconnect
		h2 := rhs.OnReaderReconnect
		ret.OnReaderReconnect = func(t trace.TopicReaderReconnectStartInfo) func(trace.TopicReaderReconnectDoneInfo) {
			if options.panicCallback != nil {
				defer func() {
					if e := recover(); e != nil {
						options.panicCallback(e)
					}
				}()
			}
			var r, r1 func(trace.TopicReaderReconnectDoneInfo)
			if h1 != nil {
				r = h1(t)
			}
			if h2 != nil {
				r1 = h2(t)
			}
			return func(t trace.TopicReaderReconnectDoneInfo) {
				if options.panicCallback != nil {
					defer func() {
						if e := recover(); e != nil {
							options.panicCallback(e)
						}
					}()
				}
				if r != nil {
					r(t)
				}
				if r1 != nil {
					r1(t)
				}
			}
		}
	}
	{
		h1 := lhs.OnReaderReconnectRequest
		h2 := rhs.OnReaderReconnectRequest
		ret.OnReaderReconnectRequest = func(t trace.TopicReaderReconnectRequestInfo) {
			if options.panicCallback != nil {
				defer func() {
					if e := recover(); e != nil {
						options.panicCallback(e)
					}
				}()
			}
			if h1 != nil {
				h1(t)
			}
			if h2 != nil {
				h2(t)
			}
		}
	}
	{
		h1 := lhs.OnReaderPartitionReadStartResponse
		h2 := rhs.OnReaderPartitionReadStartResponse
		ret.OnReaderPartitionReadStartResponse = func(t trace.TopicReaderPartitionReadStartResponseStartInfo) func(trace.TopicReaderPartitionReadStartResponseDoneInfo) {
			if options.panicCallback != nil {
				defer func() {
					if e := recover(); e != nil {
						options.panicCallback(e)
					}
				}()
			}
			var r, r1 func(trace.TopicReaderPartitionReadStartResponseDoneInfo)
			if h1 != nil {
				r = h1(t)
			}
			if h2 != nil {
				r1 = h2(t)
			}
			return func(t trace.TopicReaderPartitionReadStartResponseDoneInfo) {
				if options.panicCallback != nil {
					defer func() {
						if e := recover(); e != nil {
							options.panicCallback(e)
						}
					}()
				}
				if r != nil {
					r(t)
				}
				if r1 != nil {
					r1(t)
				}
			}
		}
	}
	{
		h1 := lhs.OnReaderPartitionReadStopResponse
		h2 := rhs.OnReaderPartitionReadStopResponse
		ret.OnReaderPartitionReadStopResponse = func(t trace.TopicReaderPartitionReadStopResponseStartInfo) func(trace.TopicReaderPartitionReadStopResponseDoneInfo) {
			if options.panicCallback != nil {
				defer func() {
					if e := recover(); e != nil {
						options.panicCallback(e)
					}
				}()
			}
			var r, r1 func(trace.TopicReaderPartitionReadStopResponseDoneInfo)
			if h1 != nil {
				r = h1(t)
			}
			if h2 != nil {
				r1 = h2(t)
			}
			return func(t trace.TopicReaderPartitionReadStopResponseDoneInfo) {
				if options.panicCallback != nil {
					defer func() {
						if e := recover(); e != nil {
							options.panicCallback(e)
						}
					}()
				}
				if r != nil {
					r(t)
				}
				if r1 != nil {
					r1(t)
				}
			}
		}
	}
	{
		h1 := lhs.OnReaderEndPartitionSession
		h2 := rhs.OnReaderEndPartitionSession
		ret.OnReaderEndPartitionSession = func(t trace.TopicReaderEndPartitionSessionInfo) {
			if options.panicCallback != nil {
				defer func() {
					if e := recover(); e != nil {
						options.panicCallback(e)
					}
				}()
			}
			if h1 != nil {
				h1(t)
			}
			if h2 != nil {
				h2(t)
			}
		}
	}
	{
		h1 := lhs.OnReaderCommit
		h2 := rhs.OnReaderCommit
		ret.OnReaderCommit = func(t trace.TopicReaderCommitStartInfo) func(trace.TopicReaderCommitDoneInfo) {
			if options.panicCallback != nil {
				defer func() {
					if e := recover(); e != nil {
						options.panicCallback(e)
					}
				}()
			}
			var r, r1 func(trace.TopicReaderCommitDoneInfo)
			if h1 != nil {
				r = h1(t)
			}
			if h2 != nil {
				r1 = h2(t)
			}
			return func(t trace.TopicReaderCommitDoneInfo) {
				if options.panicCallback != nil {
					defer func() {
						if e := recover(); e != nil {
							options.panicCallback(e)
						}
					}()
				}
				if r != nil {
					r(t)
				}
				if r1 != nil {
					r1(t)
				}
			}
		}
	}
	{
		h1 := lhs.OnReaderSendCommitMessage
		h2 := rhs.OnReaderSendCommitMessage
		ret.OnReaderSendCommitMessage = func(t trace.TopicReaderSendCommitMessageStartInfo) func(trace.TopicReaderSendCommitMessageDoneInfo) {
			if options.panicCallback != nil {
				defer func() {
					if e := recover(); e != nil {
						options.panicCallback(e)
					}
				}()
			}
			var r, r1 func(trace.TopicReaderSendCommitMessageDoneInfo)
			if h1 != nil {
				r = h1(t)
			}
			if h2 != nil {
				r1 = h2(t)
			}
			return func(t trace.TopicReaderSendCommitMessageDoneInfo) {
				if options.panicCallback != nil {
					defer func() {
						if e := recover(); e != nil {
							options.panicCallback(e)
						}
					}()
				}
				if r != nil {
					r(t)
				}
				if r1 != nil {
					r1(t)
				}
			}
		}
	}
	{
		h1 := lhs.OnReaderCommittedNotify
		h2 := rhs.OnReaderCommittedNotify
		ret.OnReaderCommittedNotify = func(t trace.TopicReaderCommittedNotifyInfo) {
			if options.panicCallback != nil {
				defer func() {
					if e := recover(); e != nil {
						options.panicCallback(e)
					}
				}()
			}
			if h1 != nil {
				h1(t)
			}
			if h2 != nil {
				h2(t)
			}
		}
	}
	{
		h1 := lhs.OnReaderClose
		h2 := rhs.OnReaderClose
		ret.OnReaderClose = func(t trace.TopicReaderCloseStartInfo) func(trace.TopicReaderCloseDoneInfo) {
			if options.panicCallback != nil {
				defer func() {
					if e := recover(); e != nil {
						options.panicCallback(e)
					}
				}()
			}
			var r, r1 func(trace.TopicReaderCloseDoneInfo)
			if h1 != nil {
				r = h1(t)
			}
			if h2 != nil {
				r1 = h2(t)
			}
			return func(t trace.TopicReaderCloseDoneInfo) {
				if options.panicCallback != nil {
					defer func() {
						if e := recover(); e != nil {
							options.panicCallback(e)
						}
					}()
				}
				if r != nil {
					r(t)
				}
				if r1 != nil {
					r1(t)
				}
			}
		}
	}
	{
		h1 := lhs.OnReaderInit
		h2 := rhs.OnReaderInit
		ret.OnReaderInit = func(t trace.TopicReaderInitStartInfo) func(trace.TopicReaderInitDoneInfo) {
			if options.panicCallback != nil {
				defer func() {
					if e := recover(); e != nil {
						options.panicCallback(e)
					}
				}()
			}
			var r, r1 func(trace.TopicReaderInitDoneInfo)
			if h1 != nil {
				r = h1(t)
			}
			if h2 != nil {
				r1 = h2(t)
			}
			return func(t trace.TopicReaderInitDoneInfo) {
				if options.panicCallback != nil {
					defer func() {
						if e := recover(); e != nil {
							options.panicCallback(e)
						}
					}()
				}
				if r != nil {
					r(t)
				}
				if r1 != nil {
					r1(t)
				}
			}
		}
	}
	{
		h1 := lhs.OnReaderError
		h2 := rhs.OnReaderError
		ret.OnReaderError = func(t trace.TopicReaderErrorInfo) {
			if options.panicCallback != nil {
				defer func() {
					if e := recover(); e != nil {
						options.panicCallback(e)
					}
				}()
			}
			if h1 != nil {
				h1(t)
			}
			if h2 != nil {
				h2(t)
			}
		}
	}
	{
		h1 := lhs.OnReaderUpdateToken
		h2 := rhs.OnReaderUpdateToken
		ret.OnReaderUpdateToken = func(o trace.OnReadUpdateTokenStartInfo) func(trace.OnReadUpdateTokenMiddleTokenReceivedInfo) func(trace.OnReadStreamUpdateTokenDoneInfo) {
			if options.panicCallback != nil {
				defer func() {
					if e := recover(); e != nil {
						options.panicCallback(e)
					}
				}()
			}
			var r, r1 func(trace.OnReadUpdateTokenMiddleTokenReceivedInfo) func(trace.OnReadStreamUpdateTokenDoneInfo)
			if h1 != nil {
				r = h1(o)
			}
			if h2 != nil {
				r1 = h2(o)
			}
			return func(o trace.OnReadUpdateTokenMiddleTokenReceivedInfo) func(trace.OnReadStreamUpdateTokenDoneInfo) {
				if options.panicCallback != nil {
					defer func() {
						if e := recover(); e != nil {
							options.panicCallback(e)
						}
					}()
				}
				var r2, r3 func(trace.OnReadStreamUpdateTokenDoneInfo)
				if r != nil {
					r2 = r(o)
				}
				if r1 != nil {
					r3 = r1(o)
				}
				return func(o trace.OnReadStreamUpdateTokenDoneInfo) {
					if options.panicCallback != nil {
						defer func() {
							if e := recover(); e != nil {
								options.panicCallback(e)
							}
						}()
					}
					if r2 != nil {
						r2(o)
					}
					if r3 != nil {
						r3(o)
					}
				}
			}
		}
	}
	{
		h1 := lhs.OnReaderPopBatchTx
		h2 := rhs.OnReaderPopBatchTx
		ret.OnReaderPopBatchTx = func(t trace.TopicReaderPopBatchTxStartInfo) func(trace.TopicReaderPopBatchTxDoneInfo) {
			if options.panicCallback != nil {
				defer func() {
					if e := recover(); e != nil {
						options.panicCallback(e)
					}
				}()
			}
			var r, r1 func(trace.TopicReaderPopBatchTxDoneInfo)
			if h1 != nil {
				r = h1(t)
			}
			if h2 != nil {
				r1 = h2(t)
			}
			return func(t trace.TopicReaderPopBatchTxDoneInfo) {
				if options.panicCallback != nil {
					defer func() {
						if e := recover(); e != nil {
							options.panicCallback(e)
						}
					}()
				}
				if r != nil {
					r(t)
				}
				if r1 != nil {
					r1(t)
				}
			}
		}
	}
	{
		h1 := lhs.OnReaderStreamPopBatchTx
		h2 := rhs.OnReaderStreamPopBatchTx
		ret.OnReaderStreamPopBatchTx = func(t trace.TopicReaderStreamPopBatchTxStartInfo) func(trace.TopicReaderStreamPopBatchTxDoneInfo) {
			if options.panicCallback != nil {
				defer func() {
					if e := recover(); e != nil {
						options.panicCallback(e)
					}
				}()
			}
			var r, r1 func(trace.TopicReaderStreamPopBatchTxDoneInfo)
			if h1 != nil {
				r = h1(t)
			}
			if h2 != nil {
				r1 = h2(t)
			}
			return func(t trace.TopicReaderStreamPopBatchTxDoneInfo) {
				if options.panicCallback != nil {
					defer func() {
						if e := recover(); e != nil {
							options.panicCallback(e)
						}
					}()
				}
				if r != nil {
					r(t)
				}
				if r1 != nil {
					r1(t)
				}
			}
		}
	}
	{
		h1 := lhs.OnReaderUpdateOffsetsInTransaction
		h2 := rhs.OnReaderUpdateOffsetsInTransaction
		ret.OnReaderUpdateOffsetsInTransaction = func(t trace.TopicReaderOnUpdateOffsetsInTransactionStartInfo) func(trace.TopicReaderOnUpdateOffsetsInTransactionDoneInfo) {
			if options.panicCallback != nil {
				defer func() {
					if e := recover(); e != nil {
						options.panicCallback(e)
					}
				}()
			}
			var r, r1 func(trace.TopicReaderOnUpdateOffsetsInTransactionDoneInfo)
			if h1 != nil {
				r = h1(t)
			}
			if h2 != nil {
				r1 = h2(t)
			}
			return func(t trace.TopicReaderOnUpdateOffsetsInTransactionDoneInfo) {
				if options.panicCallback != nil {
					defer func() {
						if e := recover(); e != nil {
							options.panicCallback(e)
						}
					}()
				}
				if r != nil {
					r(t)
				}
				if r1 != nil {
					r1(t)
				}
			}
		}
	}
	{
		h1 := lhs.OnReaderTransactionCompleted
		h2 := rhs.OnReaderTransactionCompleted
		ret.OnReaderTransactionCompleted = func(t trace.TopicReaderTransactionCompletedStartInfo) func(trace.TopicReaderTransactionCompletedDoneInfo) {
			if options.panicCallback != nil {
				defer func() {
					if e := recover(); e != nil {
						options.panicCallback(e)
					}
				}()
			}
			var r, r1 func(trace.TopicReaderTransactionCompletedDoneInfo)
			if h1 != nil {
				r = h1(t)
			}
			if h2 != nil {
				r1 = h2(t)
			}
			return func(t trace.TopicReaderTransactionCompletedDoneInfo) {
				if options.panicCallback != nil {
					defer func() {
						if e := recover(); e != nil {
							options.panicCallback(e)
						}
					}()
				}
				if r != nil {
					r(t)
				}
				if r1 != nil {
					r1(t)
				}
			}
		}
	}
	{
		h1 := lhs.OnReaderTransactionRollback
		h2 := rhs.OnReaderTransactionRollback
		ret.OnReaderTransactionRollback = func(t trace.TopicReaderTransactionRollbackStartInfo) func(trace.TopicReaderTransactionRollbackDoneInfo) {
			if options.panicCallback != nil {
				defer func() {
					if e := recover(); e != nil {
						options.panicCallback(e)
					}
				}()
			}
			var r, r1 func(trace.TopicReaderTransactionRollbackDoneInfo)
			if h1 != nil {
				r = h1(t)
			}
			if h2 != nil {
				r1 = h2(t)
			}
			return func(t trace.TopicReaderTransactionRollbackDoneInfo) {
				if options.panicCallback != nil {
					defer func() {
						if e := recover(); e != nil {
							options.panicCallback(e)
						}
					}()
				}
				if r != nil {
					r(t)
				}
				if r1 != nil {
					r1(t)
				}
			}
		}
	}
	{
		h1 := lhs.OnReaderSentGRPCMessage
		h2 := rhs.OnReaderSentGRPCMessage
		ret.OnReaderSentGRPCMessage = func(t trace.TopicReaderSentGRPCMessageInfo) {
			if options.panicCallback != nil {
				defer func() {
					if e := recover(); e != nil {
						options.panicCallback(e)
					}
				}()
			}
			if h1 != nil {
				h1(t)
			}
			if h2 != nil {
				h2(t)
			}
		}
	}
	{
		h1 := lhs.OnReaderReceiveGRPCMessage
		h2 := rhs.OnReaderReceiveGRPCMessage
		ret.OnReaderReceiveGRPCMessage = func(t trace.TopicReaderReceiveGRPCMessageInfo) {
			if options.panicCallback != nil {
				defer func() {
					if e := recover(); e != nil {
						options.panicCallback(e)
					}
				}()
			}
			if h1 != nil {
				h1(t)
			}
			if h2 != nil {
				h2(t)
			}
		}
	}
	{
		h1 := lhs.OnReaderSentDataRequest
		h2 := rhs.OnReaderSentDataRequest
		ret.OnReaderSentDataRequest = func(t trace.TopicReaderSentDataRequestInfo) {
			if options.panicCallback != nil {
				defer func() {
					if e := recover(); e != nil {
						options.panicCallback(e)
					}
				}()
			}
			if h1 != nil {
				h1(t)
			}
			if h2 != nil {
				h2(t)
			}
		}
	}
	{
		h1 := lhs.OnReaderReceiveDataResponse
		h2 := rhs.OnReaderReceiveDataResponse
		ret.OnReaderReceiveDataResponse = func(t trace.TopicReaderReceiveDataResponseStartInfo) func(trace.TopicReaderReceiveDataResponseDoneInfo) {
			if options.panicCallback != nil {
				defer func() {
					if e := recover(); e != nil {
						options.panicCallback(e)
					}
				}()
			}
			var r, r1 func(trace.TopicReaderReceiveDataResponseDoneInfo)
			if h1 != nil {
				r = h1(t)
			}
			if h2 != nil {
				r1 = h2(t)
			}
			return func(t trace.TopicReaderReceiveDataResponseDoneInfo) {
				if options.panicCallback != nil {
					defer func() {
						if e := recover(); e != nil {
							options.panicCallback(e)
						}
					}()
				}
				if r != nil {
					r(t)
				}
				if r1 != nil {
					r1(t)
				}
			}
		}
	}
	{
		h1 := lhs.OnReaderReadMessages
		h2 := rhs.OnReaderReadMessages
		ret.OnReaderReadMessages = func(t trace.TopicReaderReadMessagesStartInfo) func(trace.TopicReaderReadMessagesDoneInfo) {
			if options.panicCallback != nil {
				defer func() {
					if e := recover(); e != nil {
						options.panicCallback(e)
					}
				}()
			}
			var r, r1 func(trace.TopicReaderReadMessagesDoneInfo)
			if h1 != nil {
				r = h1(t)
			}
			if h2 != nil {
				r1 = h2(t)
			}
			return func(t trace.TopicReaderReadMessagesDoneInfo) {
				if options.panicCallback != nil {
					defer func() {
						if e := recover(); e != nil {
							options.panicCallback(e)
						}
					}()
				}
				if r != nil {
					r(t)
				}
				if r1 != nil {
					r1(t)
				}
			}
		}
	}
	{
		h1 := lhs.OnReaderUnknownGrpcMessage
		h2 := rhs.OnReaderUnknownGrpcMessage
		ret.OnReaderUnknownGrpcMessage = func(o trace.OnReadUnknownGrpcMessageInfo) {
			if options.panicCallback != nil {
				defer func() {
					if e := recover(); e != nil {
						options.panicCallback(e)
					}
				}()
			}
			if h1 != nil {
				h1(o)
			}
			if h2 != nil {
				h2(o)
			}
		}
	}
	{
		h1 := lhs.OnWriterReconnect
		h2 := rhs.OnWriterReconnect
		ret.OnWriterReconnect = func(t trace.TopicWriterReconnectStartInfo) func(trace.TopicWriterReconnectConnectedInfo) func(trace.TopicWriterReconnectDoneInfo) {
			if options.panicCallback != nil {
				defer func() {
					if e := recover(); e != nil {
						options.panicCallback(e)
					}
				}()
			}
			var r, r1 func(trace.TopicWriterReconnectConnectedInfo) func(trace.TopicWriterReconnectDoneInfo)
			if h1 != nil {
				r = h1(t)
			}
			if h2 != nil {
				r1 = h2(t)
			}
			return func(t trace.TopicWriterReconnectConnectedInfo) func(trace.TopicWriterReconnectDoneInfo) {
				if options.panicCallback != nil {
					defer func() {
						if e := recover(); e != nil {
							options.panicCallback(e)
						}
					}()
				}
				var r2, r3 func(trace.TopicWriterReconnectDoneInfo)
				if r != nil {
					r2 = r(t)
				}
				if r1 != nil {
					r3 = r1(t)
				}
				return func(t trace.TopicWriterReconnectDoneInfo) {
					if options.panicCallback != nil {
						defer func() {
							if e := recover(); e != nil {
								options.panicCallback(e)
							}
						}()
					}
					if r2 != nil {
						r2(t)
					}
					if r3 != nil {
						r3(t)
					}
				}
			}
		}
	}
	{
		h1 := lhs.OnWriterInitStream
		h2 := rhs.OnWriterInitStream
		ret.OnWriterInitStream = func(t trace.TopicWriterInitStreamStartInfo) func(trace.TopicWriterInitStreamDoneInfo) {
			if options.panicCallback != nil {
				defer func() {
					if e := recover(); e != nil {
						options.panicCallback(e)
					}
				}()
			}
			var r, r1 func(trace.TopicWriterInitStreamDoneInfo)
			if h1 != nil {
				r = h1(t)
			}
			if h2 != nil {
				r1 = h2(t)
			}
			return func(t trace.TopicWriterInitStreamDoneInfo) {
				if options.panicCallback != nil {
					defer func() {
						if e := recover(); e != nil {
							options.panicCallback(e)
						}
					}()
				}
				if r != nil {
					r(t)
				}
				if r1 != nil {
					r1(t)
				}
			}
		}
	}
	{
		h1 := lhs.OnWriterClose
		h2 := rhs.OnWriterClose
		ret.OnWriterClose = func(t trace.TopicWriterCloseStartInfo) func(trace.TopicWriterCloseDoneInfo) {
			if options.panicCallback != nil {
				defer func() {
					if e := recover(); e != nil {
						options.panicCallback(e)
					}
				}()
			}
			var r, r1 func(trace.TopicWriterCloseDoneInfo)
			if h1 != nil {
				r = h1(t)
			}
			if h2 != nil {
				r1 = h2(t)
			}
			return func(t trace.TopicWriterCloseDoneInfo) {
				if options.panicCallback != nil {
					defer func() {
						if e := recover(); e != nil {
							options.panicCallback(e)
						}
					}()
				}
				if r != nil {
					r(t)
				}
				if r1 != nil {
					r1(t)
				}
			}
		}
	}
	{
		h1 := lhs.OnWriterBeforeCommitTransaction
		h2 := rhs.OnWriterBeforeCommitTransaction
		ret.OnWriterBeforeCommitTransaction = func(t trace.TopicOnWriterBeforeCommitTransactionStartInfo) func(trace.TopicOnWriterBeforeCommitTransactionDoneInfo) {
			if options.panicCallback != nil {
				defer func() {
					if e := recover(); e != nil {
						options.panicCallback(e)
					}
				}()
			}
			var r, r1 func(trace.TopicOnWriterBeforeCommitTransactionDoneInfo)
			if h1 != nil {
				r = h1(t)
			}
			if h2 != nil {
				r1 = h2(t)
			}
			return func(t trace.TopicOnWriterBeforeCommitTransactionDoneInfo) {
				if options.panicCallback != nil {
					defer func() {
						if e := recover(); e != nil {
							options.panicCallback(e)
						}
					}()
				}
				if r != nil {
					r(t)
				}
				if r1 != nil {
					r1(t)
				}
			}
		}
	}
	{
		h1 := lhs.OnWriterAfterFinishTransaction
		h2 := rhs.OnWriterAfterFinishTransaction
		ret.OnWriterAfterFinishTransaction = func(t trace.TopicOnWriterAfterFinishTransactionStartInfo) func(trace.TopicOnWriterAfterFinishTransactionDoneInfo) {
			if options.panicCallback != nil {
				defer func() {
					if e := recover(); e != nil {
						options.panicCallback(e)
					}
				}()
			}
			var r, r1 func(trace.TopicOnWriterAfterFinishTransactionDoneInfo)
			if h1 != nil {
				r = h1(t)
			}
			if h2 != nil {
				r1 = h2(t)
			}
			return func(t trace.TopicOnWriterAfterFinishTransactionDoneInfo) {
				if options.panicCallback != nil {
					defer func() {
						if e := recover(); e != nil {
							options.panicCallback(e)
						}
					}()
				}
				if r != nil {
					r(t)
				}
				if r1 != nil {
					r1(t)
				}
			}
		}
	}
	{
		h1 := lhs.OnWriterCompressMessages
		h2 := rhs.OnWriterCompressMessages
		ret.OnWriterCompressMessages = func(t trace.TopicWriterCompressMessagesStartInfo) func(trace.TopicWriterCompressMessagesDoneInfo) {
			if options.panicCallback != nil {
				defer func() {
					if e := recover(); e != nil {
						options.panicCallback(e)
					}
				}()
			}
			var r, r1 func(trace.TopicWriterCompressMessagesDoneInfo)
			if h1 != nil {
				r = h1(t)
			}
			if h2 != nil {
				r1 = h2(t)
			}
			return func(t trace.TopicWriterCompressMessagesDoneInfo) {
				if options.panicCallback != nil {
					defer func() {
						if e := recover(); e != nil {
							options.panicCallback(e)
						}
					}()
				}
				if r != nil {
					r(t)
				}
				if r1 != nil {
					r1(t)
				}
			}
		}
	}
	{
		h1 := lhs.OnWriterSendMessages
		h2 := rhs.OnWriterSendMessages
		ret.OnWriterSendMessages = func(t trace.TopicWriterSendMessagesStartInfo) func(trace.TopicWriterSendMessagesDoneInfo) {
			if options.panicCallback != nil {
				defer func() {
					if e := recover(); e != nil {
						options.panicCallback(e)
					}
				}()
			}
			var r, r1 func(trace.TopicWriterSendMessagesDoneInfo)
			if h1 != nil {
				r = h1(t)
			}
			if h2 != nil {
				r1 = h2(t)
			}
			return func(t trace.TopicWriterSendMessagesDoneInfo) {
				if options.panicCallback != nil {
					defer func() {
						if e := recover(); e != nil {
							options.panicCallback(e)
						}
					}()
				}
				if r != nil {
					r(t)
				}
				if r1 != nil {
					r1(t)
				}
			}
		}
	}
	{
		h1 := lhs.OnWriterReceiveResult
		h2 := rhs.OnWriterReceiveResult
		ret.OnWriterReceiveResult = func(t trace.TopicWriterResultMessagesInfo) {
			if options.panicCallback != nil {
				defer func() {
					if e := recover(); e != nil {
						options.panicCallback(e)
					}
				}()
			}
			if h1 != nil {
				h1(t)
			}
			if h2 != nil {
				h2(t)
			}
		}
	}
	{
		h1 := lhs.OnWriterSentGRPCMessage
		h2 := rhs.OnWriterSentGRPCMessage
		ret.OnWriterSentGRPCMessage = func(t trace.TopicWriterSentGRPCMessageInfo) {
			if options.panicCallback != nil {
				defer func() {
					if e := recover(); e != nil {
						options.panicCallback(e)
					}
				}()
			}
			if h1 != nil {
				h1(t)
			}
			if h2 != nil {
				h2(t)
			}
		}
	}
	{
		h1 := lhs.OnWriterReceiveGRPCMessage
		h2 := rhs.OnWriterReceiveGRPCMessage
		ret.OnWriterReceiveGRPCMessage = func(t trace.TopicWriterReceiveGRPCMessageInfo) {
			if options.panicCallback != nil {
				defer func() {
					if e := recover(); e != nil {
						options.panicCallback(e)
					}
				}()
			}
			if h1 != nil {
				h1(t)
			}
			if h2 != nil {
				h2(t)
			}
		}
	}
	{
		h1 := lhs.OnWriterReadUnknownGrpcMessage
		h2 := rhs.OnWriterReadUnknownGrpcMessage
		ret.OnWriterReadUnknownGrpcMessage = func(t trace.TopicOnWriterReadUnknownGrpcMessageInfo) {
			if options.panicCallback != nil {
				defer func() {
					if e := recover(); e != nil {
						options.panicCallback(e)
					}
				}()
			}
			if h1 != nil {
				h1(t)
			}
			if h2 != nil {
				h2(t)
			}
		}
	}
	{
		h1 := lhs.OnListenerStart
		h2 := rhs.OnListenerStart
		ret.OnListenerStart = func(t trace.TopicListenerStartInfo) {
			if options.panicCallback != nil {
				defer func() {
					if e := recover(); e != nil {
						options.panicCallback(e)
					}
				}()
			}
			if h1 != nil {
				h1(t)
			}
			if h2 != nil {
				h2(t)
			}
		}
	}
	{
		h1 := lhs.OnListenerInit
		h2 := rhs.OnListenerInit
		ret.OnListenerInit = func(t trace.TopicListenerInitStartInfo) func(trace.TopicListenerInitDoneInfo) {
			if options.panicCallback != nil {
				defer func() {
					if e := recover(); e != nil {
						options.panicCallback(e)
					}
				}()
			}
			var r, r1 func(trace.TopicListenerInitDoneInfo)
			if h1 != nil {
				r = h1(t)
			}
			if h2 != nil {
				r1 = h2(t)
			}
			return func(t trace.TopicListenerInitDoneInfo) {
				if options.panicCallback != nil {
					defer func() {
						if e := recover(); e != nil {
							options.panicCallback(e)
						}
					}()
				}
				if r != nil {
					r(t)
				}
				if r1 != nil {
					r1(t)
				}
			}
		}
	}
	{
		h1 := lhs.OnListenerReceiveMessage
		h2 := rhs.OnListenerReceiveMessage
		ret.OnListenerReceiveMessage = func(t trace.TopicListenerReceiveMessageInfo) {
			if options.panicCallback != nil {
				defer func() {
					if e := recover(); e != nil {
						options.panicCallback(e)
					}
				}()
			}
			if h1 != nil {
				h1(t)
			}
			if h2 != nil {
				h2(t)
			}
		}
	}
	{
		h1 := lhs.OnListenerRouteMessage
		h2 := rhs.OnListenerRouteMessage
		ret.OnListenerRouteMessage = func(t trace.TopicListenerRouteMessageInfo) {
			if options.panicCallback != nil {
				defer func() {
					if e := recover(); e != nil {
						options.panicCallback(e)
					}
				}()
			}
			if h1 != nil {
				h1(t)
			}
			if h2 != nil {
				h2(t)
			}
		}
	}
	{
		h1 := lhs.OnListenerSplitMessage
		h2 := rhs.OnListenerSplitMessage
		ret.OnListenerSplitMessage = func(t trace.TopicListenerSplitMessageInfo) {
			if options.panicCallback != nil {
				defer func() {
					if e := recover(); e != nil {
						options.panicCallback(e)
					}
				}()
			}
			if h1 != nil {
				h1(t)
			}
			if h2 != nil {
				h2(t)
			}
		}
	}
	{
		h1 := lhs.OnListenerError
		h2 := rhs.OnListenerError
		ret.OnListenerError = func(t trace.TopicListenerErrorInfo) {
			if options.panicCallback != nil {
				defer func() {
					if e := recover(); e != nil {
						options.panicCallback(e)
					}
				}()
			}
			if h1 != nil {
				h1(t)
			}
			if h2 != nil {
				h2(t)
			}
		}
	}
	{
		h1 := lhs.OnListenerClose
		h2 := rhs.OnListenerClose
		ret.OnListenerClose = func(t trace.TopicListenerCloseStartInfo) func(trace.TopicListenerCloseDoneInfo) {
			if options.panicCallback != nil {
				defer func() {
					if e := recover(); e != nil {
						options.panicCallback(e)
					}
				}()
			}
			var r, r1 func(trace.TopicListenerCloseDoneInfo)
			if h1 != nil {
				r = h1(t)
			}
			if h2 != nil {
				r1 = h2(t)
			}
			return func(t trace.TopicListenerCloseDoneInfo) {
				if options.panicCallback != nil {
					defer func() {
						if e := recover(); e != nil {
							options.panicCallback(e)
						}
					}()
				}
				if r != nil {
					r(t)
				}
				if r1 != nil {
					r1(t)
				}
			}
		}
	}
	{
		h1 := lhs.OnPartitionWorkerStart
		h2 := rhs.OnPartitionWorkerStart
		ret.OnPartitionWorkerStart = func(t trace.TopicPartitionWorkerStartInfo) {
			if options.panicCallback != nil {
				defer func() {
					if e := recover(); e != nil {
						options.panicCallback(e)
					}
				}()
			}
			if h1 != nil {
				h1(t)
			}
			if h2 != nil {
				h2(t)
			}
		}
	}
	{
		h1 := lhs.OnPartitionWorkerProcessMessage
		h2 := rhs.OnPartitionWorkerProcessMessage
		ret.OnPartitionWorkerProcessMessage = func(t trace.TopicPartitionWorkerProcessMessageStartInfo) func(trace.TopicPartitionWorkerProcessMessageDoneInfo) {
			if options.panicCallback != nil {
				defer func() {
					if e := recover(); e != nil {
						options.panicCallback(e)
					}
				}()
			}
			var r, r1 func(trace.TopicPartitionWorkerProcessMessageDoneInfo)
			if h1 != nil {
				r = h1(t)
			}
			if h2 != nil {
				r1 = h2(t)
			}
			return func(t trace.TopicPartitionWorkerProcessMessageDoneInfo) {
				if options.panicCallback != nil {
					defer func() {
						if e := recover(); e != nil {
							options.panicCallback(e)
						}
					}()
				}
				if r != nil {
					r(t)
				}
				if r1 != nil {
					r1(t)
				}
			}
		}
	}
	{
		h1 := lhs.OnPartitionWorkerHandlerCall
		h2 := rhs.OnPartitionWorkerHandlerCall
		ret.OnPartitionWorkerHandlerCall = func(t trace.TopicPartitionWorkerHandlerCallStartInfo) func(trace.TopicPartitionWorkerHandlerCallDoneInfo) {
			if options.panicCallback != nil {
				defer func() {
					if e := recover(); e != nil {
						options.panicCallback(e)
					}
				}()
			}
			var r, r1 func(trace.TopicPartitionWorkerHandlerCallDoneInfo)
			if h1 != nil {
				r = h1(t)
			}
			if h2 != nil {
				r1 = h2(t)
			}
			return func(t trace.TopicPartitionWorkerHandlerCallDoneInfo) {
				if options.panicCallback != nil {
					defer func() {
						if e := recover(); e != nil {
							options.panicCallback(e)
						}
					}()
				}
				if r != nil {
					r(t)
				}
				if r1 != nil {
					r1(t)
				}
			}
		}
	}
	{
		h1 := lhs.OnPartitionWorkerStop
		h2 := rhs.OnPartitionWorkerStop
		ret.OnPartitionWorkerStop = func(t trace.TopicPartitionWorkerStopStartInfo) func(trace.TopicPartitionWorkerStopDoneInfo) {
			if options.panicCallback != nil {
				defer func() {
					if e := recover(); e != nil {
						options.panicCallback(e)
					}
				}()
			}
			var r, r1 func(trace.TopicPartitionWorkerStopDoneInfo)
			if h1 != nil {
				r = h1(t)
			}
			if h2 != nil {
				r1 = h2(t)
			}
			return func(t trace.TopicPartitionWorkerStopDoneInfo) {
				if options.panicCallback != nil {
					defer func() {
						if e := recover(); e != nil {
							options.panicCallback(e)
						}
					}()
				}
				if r != nil {
					r(t)
				}
				if r1 != nil {
					r1(t)
				}
			}
		}
	}
	{
		h1 := lhs.OnListenerSendDataRequest
		h2 := rhs.OnListenerSendDataRequest
		ret.OnListenerSendDataRequest = func(t trace.TopicListenerSendDataRequestInfo) {
			if options.panicCallback != nil {
				defer func() {
					if e := recover(); e != nil {
						options.panicCallback(e)
					}
				}()
			}
			if h1 != nil {
				h1(t)
			}
			if h2 != nil {
				h2(t)
			}
		}
	}
	{
		h1 := lhs.OnListenerUnknownMessage
		h2 := rhs.OnListenerUnknownMessage
		ret.OnListenerUnknownMessage = func(t trace.TopicListenerUnknownMessageInfo) {
			if options.panicCallback != nil {
				defer func() {
					if e := recover(); e != nil {
						options.panicCallback(e)
					}
				}()
			}
			if h1 != nil {
				h1(t)
			}
			if h2 != nil {
				h2(t)
			}
		}
	}
	return &ret
}
func onReaderStart(t *trace.Topic, info trace.TopicReaderStartInfo) {
	fn := t.OnReaderStart
	if fn == nil {
		return
	}
	fn(info)
}
func onReaderReconnect(t *trace.Topic, t1 trace.TopicReaderReconnectStartInfo) func(trace.TopicReaderReconnectDoneInfo) {
	fn := t.OnReaderReconnect
	if fn == nil {
		return func(trace.TopicReaderReconnectDoneInfo) {
			return
		}
	}
	res := fn(t1)
	if res == nil {
		return func(trace.TopicReaderReconnectDoneInfo) {
			return
		}
	}
	return res
}
func onReaderReconnectRequest(t *trace.Topic, t1 trace.TopicReaderReconnectRequestInfo) {
	fn := t.OnReaderReconnectRequest
	if fn == nil {
		return
	}
	fn(t1)
}
func onReaderPartitionReadStartResponse(t *trace.Topic, t1 trace.TopicReaderPartitionReadStartResponseStartInfo) func(trace.TopicReaderPartitionReadStartResponseDoneInfo) {
	fn := t.OnReaderPartitionReadStartResponse
	if fn == nil {
		return func(trace.TopicReaderPartitionReadStartResponseDoneInfo) {
			return
		}
	}
	res := fn(t1)
	if res == nil {
		return func(trace.TopicReaderPartitionReadStartResponseDoneInfo) {
			return
		}
	}
	return res
}
func onReaderPartitionReadStopResponse(t *trace.Topic, t1 trace.TopicReaderPartitionReadStopResponseStartInfo) func(trace.TopicReaderPartitionReadStopResponseDoneInfo) {
	fn := t.OnReaderPartitionReadStopResponse
	if fn == nil {
		return func(trace.TopicReaderPartitionReadStopResponseDoneInfo) {
			return
		}
	}
	res := fn(t1)
	if res == nil {
		return func(trace.TopicReaderPartitionReadStopResponseDoneInfo) {
			return
		}
	}
	return res
}
func onReaderEndPartitionSession(t *trace.Topic, t1 trace.TopicReaderEndPartitionSessionInfo) {
	fn := t.OnReaderEndPartitionSession
	if fn == nil {
		return
	}
	fn(t1)
}
func onReaderCommit(t *trace.Topic, t1 trace.TopicReaderCommitStartInfo) func(trace.TopicReaderCommitDoneInfo) {
	fn := t.OnReaderCommit
	if fn == nil {
		return func(trace.TopicReaderCommitDoneInfo) {
			return
		}
	}
	res := fn(t1)
	if res == nil {
		return func(trace.TopicReaderCommitDoneInfo) {
			return
		}
	}
	return res
}
func onReaderSendCommitMessage(t *trace.Topic, t1 trace.TopicReaderSendCommitMessageStartInfo) func(trace.TopicReaderSendCommitMessageDoneInfo) {
	fn := t.OnReaderSendCommitMessage
	if fn == nil {
		return func(trace.TopicReaderSendCommitMessageDoneInfo) {
			return
		}
	}
	res := fn(t1)
	if res == nil {
		return func(trace.TopicReaderSendCommitMessageDoneInfo) {
			return
		}
	}
	return res
}
func onReaderCommittedNotify(t *trace.Topic, t1 trace.TopicReaderCommittedNotifyInfo) {
	fn := t.OnReaderCommittedNotify
	if fn == nil {
		return
	}
	fn(t1)
}
func onReaderClose(t *trace.Topic, t1 trace.TopicReaderCloseStartInfo) func(trace.TopicReaderCloseDoneInfo) {
	fn := t.OnReaderClose
	if fn == nil {
		return func(trace.TopicReaderCloseDoneInfo) {
			return
		}
	}
	res := fn(t1)
	if res == nil {
		return func(trace.TopicReaderCloseDoneInfo) {
			return
		}
	}
	return res
}
func onReaderInit(t *trace.Topic, t1 trace.TopicReaderInitStartInfo) func(trace.TopicReaderInitDoneInfo) {
	fn := t.OnReaderInit
	if fn == nil {
		return func(trace.TopicReaderInitDoneInfo) {
			return
		}
	}
	res := fn(t1)
	if res == nil {
		return func(trace.TopicReaderInitDoneInfo) {
			return
		}
	}
	return res
}
func onReaderError(t *trace.Topic, t1 trace.TopicReaderErrorInfo) {
	fn := t.OnReaderError
	if fn == nil {
		return
	}
	fn(t1)
}
func onReaderUpdateToken(t *trace.Topic, o trace.OnReadUpdateTokenStartInfo) func(trace.OnReadUpdateTokenMiddleTokenReceivedInfo) func(trace.OnReadStreamUpdateTokenDoneInfo) {
	fn := t.OnReaderUpdateToken
	if fn == nil {
		return func(trace.OnReadUpdateTokenMiddleTokenReceivedInfo) func(trace.OnReadStreamUpdateTokenDoneInfo) {
			return func(trace.OnReadStreamUpdateTokenDoneInfo) {
				return
			}
		}
	}
	res := fn(o)
	if res == nil {
		return func(trace.OnReadUpdateTokenMiddleTokenReceivedInfo) func(trace.OnReadStreamUpdateTokenDoneInfo) {
			return func(trace.OnReadStreamUpdateTokenDoneInfo) {
				return
			}
		}
	}
	return func(o trace.OnReadUpdateTokenMiddleTokenReceivedInfo) func(trace.OnReadStreamUpdateTokenDoneInfo) {
		res := res(o)
		if res == nil {
			return func(trace.OnReadStreamUpdateTokenDoneInfo) {
				return
			}
		}
		return res
	}
}
func onReaderPopBatchTx(t *trace.Topic, t1 trace.TopicReaderPopBatchTxStartInfo) func(trace.TopicReaderPopBatchTxDoneInfo) {
	fn := t.OnReaderPopBatchTx
	if fn == nil {
		return func(trace.TopicReaderPopBatchTxDoneInfo) {
			return
		}
	}
	res := fn(t1)
	if res == nil {
		return func(trace.TopicReaderPopBatchTxDoneInfo) {
			return
		}
	}
	return res
}
func onReaderStreamPopBatchTx(t *trace.Topic, t1 trace.TopicReaderStreamPopBatchTxStartInfo) func(trace.TopicReaderStreamPopBatchTxDoneInfo) {
	fn := t.OnReaderStreamPopBatchTx
	if fn == nil {
		return func(trace.TopicReaderStreamPopBatchTxDoneInfo) {
			return
		}
	}
	res := fn(t1)
	if res == nil {
		return func(trace.TopicReaderStreamPopBatchTxDoneInfo) {
			return
		}
	}
	return res
}
func onReaderUpdateOffsetsInTransaction(t *trace.Topic, t1 trace.TopicReaderOnUpdateOffsetsInTransactionStartInfo) func(trace.TopicReaderOnUpdateOffsetsInTransactionDoneInfo) {
	fn := t.OnReaderUpdateOffsetsInTransaction
	if fn == nil {
		return func(trace.TopicReaderOnUpdateOffsetsInTransactionDoneInfo) {
			return
		}
	}
	res := fn(t1)
	if res == nil {
		return func(trace.TopicReaderOnUpdateOffsetsInTransactionDoneInfo) {
			return
		}
	}
	return res
}
func onReaderTransactionCompleted(t *trace.Topic, t1 trace.TopicReaderTransactionCompletedStartInfo) func(trace.TopicReaderTransactionCompletedDoneInfo) {
	fn := t.OnReaderTransactionCompleted
	if fn == nil {
		return func(trace.TopicReaderTransactionCompletedDoneInfo) {
			return
		}
	}
	res := fn(t1)
	if res == nil {
		return func(trace.TopicReaderTransactionCompletedDoneInfo) {
			return
		}
	}
	return res
}
func onReaderTransactionRollback(t *trace.Topic, t1 trace.TopicReaderTransactionRollbackStartInfo) func(trace.TopicReaderTransactionRollbackDoneInfo) {
	fn := t.OnReaderTransactionRollback
	if fn == nil {
		return func(trace.TopicReaderTransactionRollbackDoneInfo) {
			return
		}
	}
	res := fn(t1)
	if res == nil {
		return func(trace.TopicReaderTransactionRollbackDoneInfo) {
			return
		}
	}
	return res
}
func onReaderSentGRPCMessage(t *trace.Topic, t1 trace.TopicReaderSentGRPCMessageInfo) {
	fn := t.OnReaderSentGRPCMessage
	if fn == nil {
		return
	}
	fn(t1)
}
func onReaderReceiveGRPCMessage(t *trace.Topic, t1 trace.TopicReaderReceiveGRPCMessageInfo) {
	fn := t.OnReaderReceiveGRPCMessage
	if fn == nil {
		return
	}
	fn(t1)
}
func onReaderSentDataRequest(t *trace.Topic, t1 trace.TopicReaderSentDataRequestInfo) {
	fn := t.OnReaderSentDataRequest
	if fn == nil {
		return
	}
	fn(t1)
}
func onReaderReceiveDataResponse(t *trace.Topic, t1 trace.TopicReaderReceiveDataResponseStartInfo) func(trace.TopicReaderReceiveDataResponseDoneInfo) {
	fn := t.OnReaderReceiveDataResponse
	if fn == nil {
		return func(trace.TopicReaderReceiveDataResponseDoneInfo) {
			return
		}
	}
	res := fn(t1)
	if res == nil {
		return func(trace.TopicReaderReceiveDataResponseDoneInfo) {
			return
		}
	}
	return res
}
func onReaderReadMessages(t *trace.Topic, t1 trace.TopicReaderReadMessagesStartInfo) func(trace.TopicReaderReadMessagesDoneInfo) {
	fn := t.OnReaderReadMessages
	if fn == nil {
		return func(trace.TopicReaderReadMessagesDoneInfo) {
			return
		}
	}
	res := fn(t1)
	if res == nil {
		return func(trace.TopicReaderReadMessagesDoneInfo) {
			return
		}
	}
	return res
}
func onReaderUnknownGrpcMessage(t *trace.Topic, o trace.OnReadUnknownGrpcMessageInfo) {
	fn := t.OnReaderUnknownGrpcMessage
	if fn == nil {
		return
	}
	fn(o)
}
func onWriterReconnect(t *trace.Topic, t1 trace.TopicWriterReconnectStartInfo) func(trace.TopicWriterReconnectConnectedInfo) func(trace.TopicWriterReconnectDoneInfo) {
	fn := t.OnWriterReconnect
	if fn == nil {
		return func(trace.TopicWriterReconnectConnectedInfo) func(trace.TopicWriterReconnectDoneInfo) {
			return func(trace.TopicWriterReconnectDoneInfo) {
				return
			}
		}
	}
	res := fn(t1)
	if res == nil {
		return func(trace.TopicWriterReconnectConnectedInfo) func(trace.TopicWriterReconnectDoneInfo) {
			return func(trace.TopicWriterReconnectDoneInfo) {
				return
			}
		}
	}
	return func(t trace.TopicWriterReconnectConnectedInfo) func(trace.TopicWriterReconnectDoneInfo) {
		res := res(t)
		if res == nil {
			return func(trace.TopicWriterReconnectDoneInfo) {
				return
			}
		}
		return res
	}
}
func onWriterInitStream(t *trace.Topic, t1 trace.TopicWriterInitStreamStartInfo) func(trace.TopicWriterInitStreamDoneInfo) {
	fn := t.OnWriterInitStream
	if fn == nil {
		return func(trace.TopicWriterInitStreamDoneInfo) {
			return
		}
	}
	res := fn(t1)
	if res == nil {
		return func(trace.TopicWriterInitStreamDoneInfo) {
			return
		}
	}
	return res
}
func onWriterClose(t *trace.Topic, t1 trace.TopicWriterCloseStartInfo) func(trace.TopicWriterCloseDoneInfo) {
	fn := t.OnWriterClose
	if fn == nil {
		return func(trace.TopicWriterCloseDoneInfo) {
			return
		}
	}
	res := fn(t1)
	if res == nil {
		return func(trace.TopicWriterCloseDoneInfo) {
			return
		}
	}
	return res
}
func onWriterBeforeCommitTransaction(t *trace.Topic, t1 trace.TopicOnWriterBeforeCommitTransactionStartInfo) func(trace.TopicOnWriterBeforeCommitTransactionDoneInfo) {
	fn := t.OnWriterBeforeCommitTransaction
	if fn == nil {
		return func(trace.TopicOnWriterBeforeCommitTransactionDoneInfo) {
			return
		}
	}
	res := fn(t1)
	if res == nil {
		return func(trace.TopicOnWriterBeforeCommitTransactionDoneInfo) {
			return
		}
	}
	return res
}
func onWriterAfterFinishTransaction(t *trace.Topic, t1 trace.TopicOnWriterAfterFinishTransactionStartInfo) func(trace.TopicOnWriterAfterFinishTransactionDoneInfo) {
	fn := t.OnWriterAfterFinishTransaction
	if fn == nil {
		return func(trace.TopicOnWriterAfterFinishTransactionDoneInfo) {
			return
		}
	}
	res := fn(t1)
	if res == nil {
		return func(trace.TopicOnWriterAfterFinishTransactionDoneInfo) {
			return
		}
	}
	return res
}
func onWriterCompressMessages(t *trace.Topic, t1 trace.TopicWriterCompressMessagesStartInfo) func(trace.TopicWriterCompressMessagesDoneInfo) {
	fn := t.OnWriterCompressMessages
	if fn == nil {
		return func(trace.TopicWriterCompressMessagesDoneInfo) {
			return
		}
	}
	res := fn(t1)
	if res == nil {
		return func(trace.TopicWriterCompressMessagesDoneInfo) {
			return
		}
	}
	return res
}
func onWriterSendMessages(t *trace.Topic, t1 trace.TopicWriterSendMessagesStartInfo) func(trace.TopicWriterSendMessagesDoneInfo) {
	fn := t.OnWriterSendMessages
	if fn == nil {
		return func(trace.TopicWriterSendMessagesDoneInfo) {
			return
		}
	}
	res := fn(t1)
	if res == nil {
		return func(trace.TopicWriterSendMessagesDoneInfo) {
			return
		}
	}
	return res
}
func onWriterReceiveResult(t *trace.Topic, t1 trace.TopicWriterResultMessagesInfo) {
	fn := t.OnWriterReceiveResult
	if fn == nil {
		return
	}
	fn(t1)
}
func onWriterSentGRPCMessage(t *trace.Topic, t1 trace.TopicWriterSentGRPCMessageInfo) {
	fn := t.OnWriterSentGRPCMessage
	if fn == nil {
		return
	}
	fn(t1)
}
func onWriterReceiveGRPCMessage(t *trace.Topic, t1 trace.TopicWriterReceiveGRPCMessageInfo) {
	fn := t.OnWriterReceiveGRPCMessage
	if fn == nil {
		return
	}
	fn(t1)
}
func onWriterReadUnknownGrpcMessage(t *trace.Topic, t1 trace.TopicOnWriterReadUnknownGrpcMessageInfo) {
	fn := t.OnWriterReadUnknownGrpcMessage
	if fn == nil {
		return
	}
	fn(t1)
}
func onListenerStart(t *trace.Topic, t1 trace.TopicListenerStartInfo) {
	fn := t.OnListenerStart
	if fn == nil {
		return
	}
	fn(t1)
}
func onListenerInit(t *trace.Topic, t1 trace.TopicListenerInitStartInfo) func(trace.TopicListenerInitDoneInfo) {
	fn := t.OnListenerInit
	if fn == nil {
		return func(trace.TopicListenerInitDoneInfo) {
			return
		}
	}
	res := fn(t1)
	if res == nil {
		return func(trace.TopicListenerInitDoneInfo) {
			return
		}
	}
	return res
}
func onListenerReceiveMessage(t *trace.Topic, t1 trace.TopicListenerReceiveMessageInfo) {
	fn := t.OnListenerReceiveMessage
	if fn == nil {
		return
	}
	fn(t1)
}
func onListenerRouteMessage(t *trace.Topic, t1 trace.TopicListenerRouteMessageInfo) {
	fn := t.OnListenerRouteMessage
	if fn == nil {
		return
	}
	fn(t1)
}
func onListenerSplitMessage(t *trace.Topic, t1 trace.TopicListenerSplitMessageInfo) {
	fn := t.OnListenerSplitMessage
	if fn == nil {
		return
	}
	fn(t1)
}
func onListenerError(t *trace.Topic, t1 trace.TopicListenerErrorInfo) {
	fn := t.OnListenerError
	if fn == nil {
		return
	}
	fn(t1)
}
func onListenerClose(t *trace.Topic, t1 trace.TopicListenerCloseStartInfo) func(trace.TopicListenerCloseDoneInfo) {
	fn := t.OnListenerClose
	if fn == nil {
		return func(trace.TopicListenerCloseDoneInfo) {
			return
		}
	}
	res := fn(t1)
	if res == nil {
		return func(trace.TopicListenerCloseDoneInfo) {
			return
		}
	}
	return res
}
func onPartitionWorkerStart(t *trace.Topic, t1 trace.TopicPartitionWorkerStartInfo) {
	fn := t.OnPartitionWorkerStart
	if fn == nil {
		return
	}
	fn(t1)
}
func onPartitionWorkerProcessMessage(t *trace.Topic, t1 trace.TopicPartitionWorkerProcessMessageStartInfo) func(trace.TopicPartitionWorkerProcessMessageDoneInfo) {
	fn := t.OnPartitionWorkerProcessMessage
	if fn == nil {
		return func(trace.TopicPartitionWorkerProcessMessageDoneInfo) {
			return
		}
	}
	res := fn(t1)
	if res == nil {
		return func(trace.TopicPartitionWorkerProcessMessageDoneInfo) {
			return
		}
	}
	return res
}
func onPartitionWorkerHandlerCall(t *trace.Topic, t1 trace.TopicPartitionWorkerHandlerCallStartInfo) func(trace.TopicPartitionWorkerHandlerCallDoneInfo) {
	fn := t.OnPartitionWorkerHandlerCall
	if fn == nil {
		return func(trace.TopicPartitionWorkerHandlerCallDoneInfo) {
			return
		}
	}
	res := fn(t1)
	if res == nil {
		return func(trace.TopicPartitionWorkerHandlerCallDoneInfo) {
			return
		}
	}
	return res
}
func onPartitionWorkerStop(t *trace.Topic, t1 trace.TopicPartitionWorkerStopStartInfo) func(trace.TopicPartitionWorkerStopDoneInfo) {
	fn := t.OnPartitionWorkerStop
	if fn == nil {
		return func(trace.TopicPartitionWorkerStopDoneInfo) {
			return
		}
	}
	res := fn(t1)
	if res == nil {
		return func(trace.TopicPartitionWorkerStopDoneInfo) {
			return
		}
	}
	return res
}
func onListenerSendDataRequest(t *trace.Topic, t1 trace.TopicListenerSendDataRequestInfo) {
	fn := t.OnListenerSendDataRequest
	if fn == nil {
		return
	}
	fn(t1)
}
func onListenerUnknownMessage(t *trace.Topic, t1 trace.TopicListenerUnknownMessageInfo) {
	fn := t.OnListenerUnknownMessage
	if fn == nil {
		return
	}
	fn(t1)
}
// Internals: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#internals
func TopicOnReaderStart(t *trace.Topic, c *context.Context, readerID int64, consumer string, e error) {
	var p trace.TopicReaderStartInfo
	p.Context = c
	p.ReaderID = readerID
	p.Consumer = consumer
	p.Error = e
	onReaderStart(t, p)
}
// Internals: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#internals
func TopicOnReaderReconnect(t *trace.Topic, c *context.Context, reason error) func(error) {
	var p trace.TopicReaderReconnectStartInfo
	p.Context = c
	p.Reason = reason
	res := onReaderReconnect(t, p)
	return func(e error) {
		var p trace.TopicReaderReconnectDoneInfo
		p.Error = e
		res(p)
	}
}
// Internals: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#internals
func TopicOnReaderReconnectRequest(t *trace.Topic, c *context.Context, reason error, wasSent bool) {
	var p trace.TopicReaderReconnectRequestInfo
	p.Context = c
	p.Reason = reason
	p.WasSent = wasSent
	onReaderReconnectRequest(t, p)
}
// Internals: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#internals
func TopicOnReaderPartitionReadStartResponse(t *trace.Topic, readerConnectionID string, partitionContext *context.Context, topic string, partitionID int64, partitionSessionID int64) func(readOffset *int64, commitOffset *int64, _ error) {
	var p trace.TopicReaderPartitionReadStartResponseStartInfo
	p.ReaderConnectionID = readerConnectionID
	p.PartitionContext = partitionContext
	p.Topic = topic
	p.PartitionID = partitionID
	p.PartitionSessionID = partitionSessionID
	res := onReaderPartitionReadStartResponse(t, p)
	return func(readOffset *int64, commitOffset *int64, e error) {
		var p trace.TopicReaderPartitionReadStartResponseDoneInfo
		p.ReadOffset = readOffset
		p.CommitOffset = commitOffset
		p.Error = e
		res(p)
	}
}
// Internals: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#internals
func TopicOnReaderPartitionReadStopResponse(t *trace.Topic, readerConnectionID string, partitionContext context.Context, topic string, partitionID int64, partitionSessionID int64, committedOffset int64, graceful bool) func(error) {
	var p trace.TopicReaderPartitionReadStopResponseStartInfo
	p.ReaderConnectionID = readerConnectionID
	p.PartitionContext = partitionContext
	p.Topic = topic
	p.PartitionID = partitionID
	p.PartitionSessionID = partitionSessionID
	p.CommittedOffset = committedOffset
	p.Graceful = graceful
	res := onReaderPartitionReadStopResponse(t, p)
	return func(e error) {
		var p trace.TopicReaderPartitionReadStopResponseDoneInfo
		p.Error = e
		res(p)
	}
}
// Internals: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#internals
func TopicOnReaderEndPartitionSession(t *trace.Topic, readerConnectionID string, partitionContext context.Context, topic string, partitionID int64, partitionSessionID int64, adjacentPartitionIDs []int64, childPartitionIDs []int64) {
	var p trace.TopicReaderEndPartitionSessionInfo
	p.ReaderConnectionID = readerConnectionID
	p.PartitionContext = partitionContext
	p.Topic = topic
	p.PartitionID = partitionID
	p.PartitionSessionID = partitionSessionID
	p.AdjacentPartitionIDs = adjacentPartitionIDs
	p.ChildPartitionIDs = childPartitionIDs
	onReaderEndPartitionSession(t, p)
}
// Internals: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#internals
func TopicOnReaderCommit(t *trace.Topic, c *context.Context, topic string, partitionID int64, partitionSessionID int64, startOffset int64, endOffset int64) func(error) {
	var p trace.TopicReaderCommitStartInfo
	p.Context = c
	p.Topic = topic
	p.PartitionID = partitionID
	p.PartitionSessionID = partitionSessionID
	p.StartOffset = startOffset
	p.EndOffset = endOffset
	res := onReaderCommit(t, p)
	return func(e error) {
		var p trace.TopicReaderCommitDoneInfo
		p.Error = e
		res(p)
	}
}
// Internals: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#internals
func TopicOnReaderSendCommitMessage(t *trace.Topic, c *context.Context, commitsInfo trace.TopicReaderStreamSendCommitMessageStartMessageInfo) func(error) {
	var p trace.TopicReaderSendCommitMessageStartInfo
	p.Context = c
	p.CommitsInfo = commitsInfo
	res := onReaderSendCommitMessage(t, p)
	return func(e error) {
		var p trace.TopicReaderSendCommitMessageDoneInfo
		p.Error = e
		res(p)
	}
}
// Internals: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#internals
func TopicOnReaderCommittedNotify(t *trace.Topic, c *context.Context, readerConnectionID string, topic string, partitionID int64, partitionSessionID int64, committedOffset int64) {
	var p trace.TopicReaderCommittedNotifyInfo
	p.Context = c
	p.ReaderConnectionID = readerConnectionID
	p.Topic = topic
	p.PartitionID = partitionID
	p.PartitionSessionID = partitionSessionID
	p.CommittedOffset = committedOffset
	onReaderCommittedNotify(t, p)
}
// Internals: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#internals
func TopicOnReaderClose(t *trace.Topic, c *context.Context, readerConnectionID string, closeReason error) func(closeError error) {
	var p trace.TopicReaderCloseStartInfo
	p.Context = c
	p.ReaderConnectionID = readerConnectionID
	p.CloseReason = closeReason
	res := onReaderClose(t, p)
	return func(closeError error) {
		var p trace.TopicReaderCloseDoneInfo
		p.CloseError = closeError
		res(p)
	}
}
// Internals: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#internals
func TopicOnReaderInit(t *trace.Topic, c *context.Context, preInitReaderConnectionID string, initRequestInfo trace.TopicReadStreamInitRequestInfo) func(readerConnectionID string, _ error) {
	var p trace.TopicReaderInitStartInfo
	p.Context = c
	p.PreInitReaderConnectionID = preInitReaderConnectionID
	p.InitRequestInfo = initRequestInfo
	res := onReaderInit(t, p)
	return func(readerConnectionID string, e error) {
		var p trace.TopicReaderInitDoneInfo
		p.ReaderConnectionID = readerConnectionID
		p.Error = e
		res(p)
	}
}
// Internals: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#internals
func TopicOnReaderError(t *trace.Topic, c *context.Context, readerConnectionID string, e error) {
	var p trace.TopicReaderErrorInfo
	p.Context = c
	p.ReaderConnectionID = readerConnectionID
	p.Error = e
	onReaderError(t, p)
}
// Internals: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#internals
func TopicOnReaderUpdateToken(t *trace.Topic, c *context.Context, readerConnectionID string) func(_ *context.Context, tokenLen int, _ error) func(error) {
	var p trace.OnReadUpdateTokenStartInfo
	p.Context = c
	p.ReaderConnectionID = readerConnectionID
	res := onReaderUpdateToken(t, p)
	return func(c *context.Context, tokenLen int, e error) func(error) {
		var p trace.OnReadUpdateTokenMiddleTokenReceivedInfo
		p.Context = c
		p.TokenLen = tokenLen
		p.Error = e
		res := res(p)
		return func(e error) {
			var p trace.OnReadStreamUpdateTokenDoneInfo
			p.Error = e
			res(p)
		}
	}
}
// Internals: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#internals
func TopicOnReaderPopBatchTx(t *trace.Topic, c *context.Context, readerID int64, transactionSessionID string, tx trace.TxInfo) func(startOffset int64, endOffset int64, messagesCount int, _ error) {
	var p trace.TopicReaderPopBatchTxStartInfo
	p.Context = c
	p.ReaderID = readerID
	p.TransactionSessionID = transactionSessionID
	p.Tx = tx
	res := onReaderPopBatchTx(t, p)
	return func(startOffset int64, endOffset int64, messagesCount int, e error) {
		var p trace.TopicReaderPopBatchTxDoneInfo
		p.StartOffset = startOffset
		p.EndOffset = endOffset
		p.MessagesCount = messagesCount
		p.Error = e
		res(p)
	}
}
// Internals: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#internals
func TopicOnReaderStreamPopBatchTx(t *trace.Topic, c *context.Context, readerID int64, readerConnectionID string, transactionSessionID string, tx trace.TxInfo) func(error) {
	var p trace.TopicReaderStreamPopBatchTxStartInfo
	p.Context = c
	p.ReaderID = readerID
	p.ReaderConnectionID = readerConnectionID
	p.TransactionSessionID = transactionSessionID
	p.Tx = tx
	res := onReaderStreamPopBatchTx(t, p)
	return func(e error) {
		var p trace.TopicReaderStreamPopBatchTxDoneInfo
		p.Error = e
		res(p)
	}
}
// Internals: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#internals
func TopicOnReaderUpdateOffsetsInTransaction(t *trace.Topic, c *context.Context, readerID int64, readerConnectionID string, transactionSessionID string, tx trace.TxInfo) func(error) {
	var p trace.TopicReaderOnUpdateOffsetsInTransactionStartInfo
	p.Context = c
	p.ReaderID = readerID
	p.ReaderConnectionID = readerConnectionID
	p.TransactionSessionID = transactionSessionID
	p.Tx = tx
	res := onReaderUpdateOffsetsInTransaction(t, p)
	return func(e error) {
		var p trace.TopicReaderOnUpdateOffsetsInTransactionDoneInfo
		p.Error = e
		res(p)
	}
}
// Internals: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#internals
func TopicOnReaderTransactionCompleted(t *trace.Topic, c *context.Context, readerID int64, readerConnectionID string, transactionSessionID string, tx trace.TxInfo, transactionResult error) func() {
	var p trace.TopicReaderTransactionCompletedStartInfo
	p.Context = c
	p.ReaderID = readerID
	p.ReaderConnectionID = readerConnectionID
	p.TransactionSessionID = transactionSessionID
	p.Tx = tx
	p.TransactionResult = transactionResult
	res := onReaderTransactionCompleted(t, p)
	return func() {
		var p trace.TopicReaderTransactionCompletedDoneInfo
		res(p)
	}
}
// Internals: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#internals
func TopicOnReaderTransactionRollback(t *trace.Topic, c *context.Context, readerID int64, readerConnectionID string, transactionSessionID string, tx trace.TxInfo) func(rollbackError error) {
	var p trace.TopicReaderTransactionRollbackStartInfo
	p.Context = c
	p.ReaderID = readerID
	p.ReaderConnectionID = readerConnectionID
	p.TransactionSessionID = transactionSessionID
	p.Tx = tx
	res := onReaderTransactionRollback(t, p)
	return func(rollbackError error) {
		var p trace.TopicReaderTransactionRollbackDoneInfo
		p.RollbackError = rollbackError
		res(p)
	}
}
// Internals: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#internals
func TopicOnReaderSentGRPCMessage(t *trace.Topic, readerID int64, sessionID string, messageNumber int, message *Ydb_Topic.StreamReadMessage_FromClient, e error) {
	var p trace.TopicReaderSentGRPCMessageInfo
	p.ReaderID = readerID
	p.SessionID = sessionID
	p.MessageNumber = messageNumber
	p.Message = message
	p.Error = e
	onReaderSentGRPCMessage(t, p)
}
// Internals: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#internals
func TopicOnReaderReceiveGRPCMessage(t *trace.Topic, readerID int64, sessionID string, messageNumber int, message *Ydb_Topic.StreamReadMessage_FromServer, e error) {
	var p trace.TopicReaderReceiveGRPCMessageInfo
	p.ReaderID = readerID
	p.SessionID = sessionID
	p.MessageNumber = messageNumber
	p.Message = message
	p.Error = e
	onReaderReceiveGRPCMessage(t, p)
}
// Internals: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#internals
func TopicOnReaderSentDataRequest(t *trace.Topic, c *context.Context, readerConnectionID string, requestBytes int, localBufferSizeAfterSent int) {
	var p trace.TopicReaderSentDataRequestInfo
	p.Context = c
	p.ReaderConnectionID = readerConnectionID
	p.RequestBytes = requestBytes
	p.LocalBufferSizeAfterSent = localBufferSizeAfterSent
	onReaderSentDataRequest(t, p)
}
// Internals: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#internals
func TopicOnReaderReceiveDataResponse(t *trace.Topic, c *context.Context, readerConnectionID string, localBufferSizeAfterReceive int, dataResponse trace.TopicReaderDataResponseInfo) func(error) {
	var p trace.TopicReaderReceiveDataResponseStartInfo
	p.Context = c
	p.ReaderConnectionID = readerConnectionID
	p.LocalBufferSizeAfterReceive = localBufferSizeAfterReceive
	p.DataResponse = dataResponse
	res := onReaderReceiveDataResponse(t, p)
	return func(e error) {
		var p trace.TopicReaderReceiveDataResponseDoneInfo
		p.Error = e
		res(p)
	}
}
// Internals: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#internals
func TopicOnReaderReadMessages(t *trace.Topic, c *context.Context, minCount int, maxCount int, freeBufferCapacity int) func(messagesCount int, topic string, partitionID int64, partitionSessionID int64, offsetStart int64, offsetEnd int64, freeBufferCapacity int, _ error) {
	var p trace.TopicReaderReadMessagesStartInfo
	p.Context = c
	p.MinCount = minCount
	p.MaxCount = maxCount
	p.FreeBufferCapacity = freeBufferCapacity
	res := onReaderReadMessages(t, p)
	return func(messagesCount int, topic string, partitionID int64, partitionSessionID int64, offsetStart int64, offsetEnd int64, freeBufferCapacity int, e error) {
		var p trace.TopicReaderReadMessagesDoneInfo
		p.MessagesCount = messagesCount
		p.Topic = topic
		p.PartitionID = partitionID
		p.PartitionSessionID = partitionSessionID
		p.OffsetStart = offsetStart
		p.OffsetEnd = offsetEnd
		p.FreeBufferCapacity = freeBufferCapacity
		p.Error = e
		res(p)
	}
}
// Internals: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#internals
func TopicOnReaderUnknownGrpcMessage(t *trace.Topic, c *context.Context, readerConnectionID string, e error) {
	var p trace.OnReadUnknownGrpcMessageInfo
	p.Context = c
	p.ReaderConnectionID = readerConnectionID
	p.Error = e
	onReaderUnknownGrpcMessage(t, p)
}
// Internals: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#internals
func TopicOnWriterReconnect(t *trace.Topic, c *context.Context, writerInstanceID string, topic string, producerID string, attempt int) func(connectionResult error) func(error) {
	var p trace.TopicWriterReconnectStartInfo
	p.Context = c
	p.WriterInstanceID = writerInstanceID
	p.Topic = topic
	p.ProducerID = producerID
	p.Attempt = attempt
	res := onWriterReconnect(t, p)
	return func(connectionResult error) func(error) {
		var p trace.TopicWriterReconnectConnectedInfo
		p.ConnectionResult = connectionResult
		res := res(p)
		return func(e error) {
			var p trace.TopicWriterReconnectDoneInfo
			p.Error = e
			res(p)
		}
	}
}
// Internals: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#internals
func TopicOnWriterInitStream(t *trace.Topic, c *context.Context, writerInstanceID string, topic string, producerID string) func(sessionID string, endpoint trace.EndpointInfo, _ error) {
	var p trace.TopicWriterInitStreamStartInfo
	p.Context = c
	p.WriterInstanceID = writerInstanceID
	p.Topic = topic
	p.ProducerID = producerID
	res := onWriterInitStream(t, p)
	return func(sessionID string, endpoint trace.EndpointInfo, e error) {
		var p trace.TopicWriterInitStreamDoneInfo
		p.SessionID = sessionID
		p.Endpoint = endpoint
		p.Error = e
		res(p)
	}
}
// Internals: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#internals
func TopicOnWriterClose(t *trace.Topic, c *context.Context, writerInstanceID string, reason error) func(error) {
	var p trace.TopicWriterCloseStartInfo
	p.Context = c
	p.WriterInstanceID = writerInstanceID
	p.Reason = reason
	res := onWriterClose(t, p)
	return func(e error) {
		var p trace.TopicWriterCloseDoneInfo
		p.Error = e
		res(p)
	}
}
// Internals: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#internals
func TopicOnWriterBeforeCommitTransaction(t *trace.Topic, c *context.Context, kqpSessionID string, topicSessionID string, transactionID string) func(_ error, topicSessionID string) {
	var p trace.TopicOnWriterBeforeCommitTransactionStartInfo
	p.Context = c
	p.KqpSessionID = kqpSessionID
	p.TopicSessionID = topicSessionID
	p.TransactionID = transactionID
	res := onWriterBeforeCommitTransaction(t, p)
	return func(e error, topicSessionID string) {
		var p trace.TopicOnWriterBeforeCommitTransactionDoneInfo
		p.Error = e
		p.TopicSessionID = topicSessionID
		res(p)
	}
}
// Internals: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#internals
func TopicOnWriterAfterFinishTransaction(t *trace.Topic, c *context.Context, e error, sessionID string, transactionID string) func(closeError error) {
	var p trace.TopicOnWriterAfterFinishTransactionStartInfo
	p.Context = c
	p.Error = e
	p.SessionID = sessionID
	p.TransactionID = transactionID
	res := onWriterAfterFinishTransaction(t, p)
	return func(closeError error) {
		var p trace.TopicOnWriterAfterFinishTransactionDoneInfo
		p.CloseError = closeError
		res(p)
	}
}
// Internals: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#internals
func TopicOnWriterCompressMessages(t *trace.Topic, c *context.Context, writerInstanceID string, sessionID string, codec int32, firstSeqNo int64, messagesCount int, reason trace.TopicWriterCompressMessagesReason) func(error) {
	var p trace.TopicWriterCompressMessagesStartInfo
	p.Context = c
	p.WriterInstanceID = writerInstanceID
	p.SessionID = sessionID
	p.Codec = codec
	p.FirstSeqNo = firstSeqNo
	p.MessagesCount = messagesCount
	p.Reason = reason
	res := onWriterCompressMessages(t, p)
	return func(e error) {
		var p trace.TopicWriterCompressMessagesDoneInfo
		p.Error = e
		res(p)
	}
}
// Internals: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#internals
func TopicOnWriterSendMessages(t *trace.Topic, c *context.Context, writerInstanceID string, sessionID string, codec int32, firstSeqNo int64, messagesCount int) func(error) {
	var p trace.TopicWriterSendMessagesStartInfo
	p.Context = c
	p.WriterInstanceID = writerInstanceID
	p.SessionID = sessionID
	p.Codec = codec
	p.FirstSeqNo = firstSeqNo
	p.MessagesCount = messagesCount
	res := onWriterSendMessages(t, p)
	return func(e error) {
		var p trace.TopicWriterSendMessagesDoneInfo
		p.Error = e
		res(p)
	}
}
// Internals: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#internals
func TopicOnWriterReceiveResult(t *trace.Topic, c *context.Context, writerInstanceID string, sessionID string, partitionID int64, acks trace.TopicWriterResultMessagesInfoAcks) {
	var p trace.TopicWriterResultMessagesInfo
	p.Context = c
	p.WriterInstanceID = writerInstanceID
	p.SessionID = sessionID
	p.PartitionID = partitionID
	p.Acks = acks
	onWriterReceiveResult(t, p)
}
// Internals: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#internals
func TopicOnWriterSentGRPCMessage(t *trace.Topic, c *context.Context, topicStreamInternalID string, sessionID string, messageNumber int, message *Ydb_Topic.StreamWriteMessage_FromClient, e error) {
	var p trace.TopicWriterSentGRPCMessageInfo
	p.Context = c
	p.TopicStreamInternalID = topicStreamInternalID
	p.SessionID = sessionID
	p.MessageNumber = messageNumber
	p.Message = message
	p.Error = e
	onWriterSentGRPCMessage(t, p)
}
// Internals: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#internals
func TopicOnWriterReceiveGRPCMessage(t *trace.Topic, c *context.Context, topicStreamInternalID string, sessionID string, messageNumber int, message *Ydb_Topic.StreamWriteMessage_FromServer, e error) {
	var p trace.TopicWriterReceiveGRPCMessageInfo
	p.Context = c
	p.TopicStreamInternalID = topicStreamInternalID
	p.SessionID = sessionID
	p.MessageNumber = messageNumber
	p.Message = message
	p.Error = e
	onWriterReceiveGRPCMessage(t, p)
}
// Internals: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#internals
func TopicOnWriterReadUnknownGrpcMessage(t *trace.Topic, c *context.Context, writerInstanceID string, sessionID string, e error) {
	var p trace.TopicOnWriterReadUnknownGrpcMessageInfo
	p.Context = c
	p.WriterInstanceID = writerInstanceID
	p.SessionID = sessionID
	p.Error = e
	onWriterReadUnknownGrpcMessage(t, p)
}
// Internals: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#internals
func TopicOnListenerStart(t *trace.Topic, c *context.Context, listenerID string, consumer string, e error) {
	var p trace.TopicListenerStartInfo
	p.Context = c
	p.ListenerID = listenerID
	p.Consumer = consumer
	p.Error = e
	onListenerStart(t, p)
}
// Internals: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#internals
func TopicOnListenerInit(t *trace.Topic, c *context.Context, listenerID string, consumer string, topicSelectors []string) func(sessionID string, _ error) {
	var p trace.TopicListenerInitStartInfo
	p.Context = c
	p.ListenerID = listenerID
	p.Consumer = consumer
	p.TopicSelectors = topicSelectors
	res := onListenerInit(t, p)
	return func(sessionID string, e error) {
		var p trace.TopicListenerInitDoneInfo
		p.SessionID = sessionID
		p.Error = e
		res(p)
	}
}
// Internals: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#internals
func TopicOnListenerReceiveMessage(t *trace.Topic, c *context.Context, listenerID string, sessionID string, messageType string, bytesSize int, e error) {
	var p trace.TopicListenerReceiveMessageInfo
	p.Context = c
	p.ListenerID = listenerID
	p.SessionID = sessionID
	p.MessageType = messageType
	p.BytesSize = bytesSize
	p.Error = e
	onListenerReceiveMessage(t, p)
}
// Internals: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#internals
func TopicOnListenerRouteMessage(t *trace.Topic, c *context.Context, listenerID string, sessionID string, messageType string, partitionSessionID *int64, workerFound bool, e error) {
	var p trace.TopicListenerRouteMessageInfo
	p.Context = c
	p.ListenerID = listenerID
	p.SessionID = sessionID
	p.MessageType = messageType
	p.PartitionSessionID = partitionSessionID
	p.WorkerFound = workerFound
	p.Error = e
	onListenerRouteMessage(t, p)
}
// Internals: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#internals
func TopicOnListenerSplitMessage(t *trace.Topic, c *context.Context, listenerID string, sessionID string, messageType string, totalBatches int, totalPartitions int, splitBatches int, routedBatches int, e error) {
	var p trace.TopicListenerSplitMessageInfo
	p.Context = c
	p.ListenerID = listenerID
	p.SessionID = sessionID
	p.MessageType = messageType
	p.TotalBatches = totalBatches
	p.TotalPartitions = totalPartitions
	p.SplitBatches = splitBatches
	p.RoutedBatches = routedBatches
	p.Error = e
	onListenerSplitMessage(t, p)
}
// Internals: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#internals
func TopicOnListenerError(t *trace.Topic, c *context.Context, listenerID string, sessionID string, e error) {
	var p trace.TopicListenerErrorInfo
	p.Context = c
	p.ListenerID = listenerID
	p.SessionID = sessionID
	p.Error = e
	onListenerError(t, p)
}
// Internals: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#internals
func TopicOnListenerClose(t *trace.Topic, c *context.Context, listenerID string, sessionID string, reason error) func(workersClosed int, _ error) {
	var p trace.TopicListenerCloseStartInfo
	p.Context = c
	p.ListenerID = listenerID
	p.SessionID = sessionID
	p.Reason = reason
	res := onListenerClose(t, p)
	return func(workersClosed int, e error) {
		var p trace.TopicListenerCloseDoneInfo
		p.WorkersClosed = workersClosed
		p.Error = e
		res(p)
	}
}
// Internals: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#internals
func TopicOnPartitionWorkerStart(t *trace.Topic, c *context.Context, listenerID string, sessionID string, partitionSessionID int64, partitionID int64, topic string) {
	var p trace.TopicPartitionWorkerStartInfo
	p.Context = c
	p.ListenerID = listenerID
	p.SessionID = sessionID
	p.PartitionSessionID = partitionSessionID
	p.PartitionID = partitionID
	p.Topic = topic
	onPartitionWorkerStart(t, p)
}
// Internals: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#internals
func TopicOnPartitionWorkerProcessMessage(t *trace.Topic, c *context.Context, listenerID string, sessionID string, partitionSessionID int64, partitionID int64, topic string, messageType string, messagesCount int) func(processedMessages int, _ error) {
	var p trace.TopicPartitionWorkerProcessMessageStartInfo
	p.Context = c
	p.ListenerID = listenerID
	p.SessionID = sessionID
	p.PartitionSessionID = partitionSessionID
	p.PartitionID = partitionID
	p.Topic = topic
	p.MessageType = messageType
	p.MessagesCount = messagesCount
	res := onPartitionWorkerProcessMessage(t, p)
	return func(processedMessages int, e error) {
		var p trace.TopicPartitionWorkerProcessMessageDoneInfo
		p.ProcessedMessages = processedMessages
		p.Error = e
		res(p)
	}
}
// Internals: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#internals
func TopicOnPartitionWorkerHandlerCall(t *trace.Topic, c *context.Context, listenerID string, sessionID string, partitionSessionID int64, partitionID int64, topic string, handlerType string, messagesCount int) func(error) {
	var p trace.TopicPartitionWorkerHandlerCallStartInfo
	p.Context = c
	p.ListenerID = listenerID
	p.SessionID = sessionID
	p.PartitionSessionID = partitionSessionID
	p.PartitionID = partitionID
	p.Topic = topic
	p.HandlerType = handlerType
	p.MessagesCount = messagesCount
	res := onPartitionWorkerHandlerCall(t, p)
	return func(e error) {
		var p trace.TopicPartitionWorkerHandlerCallDoneInfo
		p.Error = e
		res(p)
	}
}
// Internals: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#internals
func TopicOnPartitionWorkerStop(t *trace.Topic, c *context.Context, listenerID string, sessionID string, partitionSessionID int64, partitionID int64, topic string, reason error) func(error) {
	var p trace.TopicPartitionWorkerStopStartInfo
	p.Context = c
	p.ListenerID = listenerID
	p.SessionID = sessionID
	p.PartitionSessionID = partitionSessionID
	p.PartitionID = partitionID
	p.Topic = topic
	p.Reason = reason
	res := onPartitionWorkerStop(t, p)
	return func(e error) {
		var p trace.TopicPartitionWorkerStopDoneInfo
		p.Error = e
		res(p)
	}
}
// Internals: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#internals
func TopicOnListenerSendDataRequest(t *trace.Topic, c *context.Context, listenerID string, sessionID string, messageType string, e error) {
	var p trace.TopicListenerSendDataRequestInfo
	p.Context = c
	p.ListenerID = listenerID
	p.SessionID = sessionID
	p.MessageType = messageType
	p.Error = e
	onListenerSendDataRequest(t, p)
}
// Internals: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#internals
func TopicOnListenerUnknownMessage(t *trace.Topic, c *context.Context, listenerID string, sessionID string, messageType string, e error) {
	var p trace.TopicListenerUnknownMessageInfo
	p.Context = c
	p.ListenerID = listenerID
	p.SessionID = sessionID
	p.MessageType = messageType
	p.Error = e
	onListenerUnknownMessage(t, p)
}
