func (conn *Conn) Serve(root interface{}, factory RecorderFactory, transformErrors func(error) error) {
	rootValue := rpcreflect.ValueOf(reflect.ValueOf(root))
	if rootValue.IsValid() {
		conn.serve(rootValue, factory, transformErrors)
	} else {
		conn.serve(nil, factory, transformErrors)
	}
}
// Serve serves RPC requests on the connection by invoking methods on
// root. Note that it does not start the connection running,
// though it may be called once the connection is already started.
//
// The server executes each client request by calling a method on root
// to obtain an object to act on; then it invokes an method on that
// object with the request parameters, possibly returning some result.
//
// Methods on the root value are of the form:
//
//      M(id string) (O, error)
//
// where M is an exported name, conventionally naming the object type,
// id is some identifier for the object and O is the type of the
// returned object.
//
// Methods defined on O may defined in one of the following forms, where
// T and R must be struct types.
//
//	Method([context.Context])
//	Method([context.Context]) R
//	Method([context.Context]) (R, error)
//	Method([context.Context]) error
//	Method([context.Context,]T)
//	Method([context.Context,]T) R
//	Method([context.Context,]T) (R, error)
//	Method([context.Context,]T) error
//
// If transformErrors is non-nil, it will be called on all returned
// non-nil errors, for example to transform the errors into ServerErrors
// with specified codes.  There will be a panic if transformErrors
// returns nil.
//
// Serve may be called at any time on a connection to change the
// set of methods being served by the connection. This will have
// no effect on calls that are currently being services.
// If root is nil, the connection will serve no methods.
Serve serves RPC requests on the connection by invoking methods on
root. Note that it does not start the connection running,
though it may be called once the connection is already started.

The server executes each client request by calling a method on root
to obtain an object to act on; then it invokes an method on that
object with the request parameters, possibly returning some result.

Methods on the root value are of the form.

M(id string) (O, error)



Methods defined on O may defined in one of the following forms, where
T and R must be struct types.

Method([context.Context])
Method([context.Context]) R
Method([context.Context]) (R, error)
Method([context.Context]) error
Method([context.Context,]T)
Method([context.Context,]T) R
Method([context.Context,]T) (R, error)
Method([context.Context,]T) error

If transformErrors is non-nil, it will be called on all returned
non-nil errors, for example to transform the errors into ServerErrors
with specified codes.  There will be a panic if transformErrors
returns nil.

Serve may be called at any time on a connection to change the
set of methods being served by the connection. This will have
no effect on calls that are currently being services.
If root is nil, the connection will serve no methods.
// Serve serves RPC requests on the connection by invoking methods on // root . Note that it does not start the connection running // though it may be called once the connection is already started . // // The server executes each client request by calling a method on root // to obtain an object to act on ; then it invokes an method on that // object with the request parameters possibly returning some result . // // Methods on the root value are of the form : // // M ( id string ) ( O error ) // // where M is an exported name conventionally naming the object type // id is some identifier for the object and O is the type of the // returned object . // // Methods defined on O may defined in one of the following forms where // T and R must be struct types . // // Method ( [ context . Context ] ) // Method ( [ context . Context ] ) R // Method ( [ context . Context ] ) ( R error ) // Method ( [ context . Context ] ) error // Method ( [ context . Context ] T ) // Method ( [ context . Context ] T ) R // Method ( [ context . Context ] T ) ( R error ) // Method ( [ context . Context ] T ) error // // If transformErrors is non - nil it will be called on all returned // non - nil errors for example to transform the errors into ServerErrors // with specified codes . There will be a panic if transformErrors // returns nil . // // Serve may be called at any time on a connection to change the // set of methods being served by the connection . This will have // no effect on calls that are currently being services . // If root is nil the connection will serve no methods .
func (conn *Conn) Serve(root interface{}, factory RecorderFactory, transformErrors func(error) error) {
	rootValue := rpcreflect.ValueOf(reflect.ValueOf(root))
	if rootValue.IsValid() {
		conn.serve(rootValue, factory, transformErrors)
	} else {
		conn.serve(nil, factory, transformErrors)
	}
}
func ( conn * Conn ) Serve ( root interface { } , factory RecorderFactory , transformErrors func ( error ) error ) { rootValue := rpcreflect . ValueOf ( reflect . ValueOf ( root ) ) if rootValue . IsValid ( ) { conn . serve ( rootValue , factory , transformErrors ) } else { conn . serve ( nil , factory , transformErrors ) } }
Serve serves RPC requests on the connection by invoking methods on
root.
Serve serves RPC requests on the connection by invoking methods on root .