blob: 6b2510e011937f9ef3bb1242a7d7f2dabd690005 [file] [log] [blame]
Herbie Ongcddf8192018-11-28 18:25:20 -08001// Copyright 2018 The Go Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style
3// license that can be found in the LICENSE file.
4
5package proto
6
Damien Neil0d3e8cc2019-04-01 13:31:55 -07007import (
8 "errors"
9
10 "github.com/golang/protobuf/v2/reflect/protoreflect"
11 "github.com/golang/protobuf/v2/runtime/protoiface"
12)
Herbie Ongcddf8192018-11-28 18:25:20 -080013
14// Message is the top-level interface that all messages must implement.
15type Message = protoreflect.ProtoMessage
Damien Neil0d3e8cc2019-04-01 13:31:55 -070016
17// errInternalNoFast indicates that fast-path operations are not available for a message.
18var errInternalNoFast = errors.New("proto: BUG: internal error (errInternalNoFast)")
19
20func protoMethods(m Message) *protoiface.Methods {
21 if x, ok := m.(protoiface.Methoder); ok {
22 return x.XXX_Methods()
23 }
24 return nil
25}