@@ -33,20 +33,42 @@ fileprivate struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAP
33
33
typealias Version = _2
34
34
}
35
35
36
- struct Echo_EchoRequest : SwiftProtobuf . Message {
37
- static let protoMessageName : String = _protobuf_package + " .EchoRequest "
36
+ struct Echo_EchoRequest {
37
+ // SwiftProtobuf.Message conformance is added in an extension below. See the
38
+ // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
39
+ // methods supported on all messages.
38
40
39
41
/// The text of a message to be echoed.
40
42
var text : String = String ( )
41
43
42
44
var unknownFields = SwiftProtobuf . UnknownStorage ( )
43
45
44
46
init ( ) { }
47
+ }
48
+
49
+ struct Echo_EchoResponse {
50
+ // SwiftProtobuf.Message conformance is added in an extension below. See the
51
+ // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
52
+ // methods supported on all messages.
53
+
54
+ /// The text of an echo response.
55
+ var text : String = String ( )
56
+
57
+ var unknownFields = SwiftProtobuf . UnknownStorage ( )
58
+
59
+ init ( ) { }
60
+ }
61
+
62
+ // MARK: - Code below here is support for the SwiftProtobuf runtime.
63
+
64
+ fileprivate let _protobuf_package = " echo "
65
+
66
+ extension Echo_EchoRequest : SwiftProtobuf . Message , SwiftProtobuf . _MessageImplementationBase , SwiftProtobuf . _ProtoNameProviding {
67
+ static let protoMessageName : String = _protobuf_package + " .EchoRequest "
68
+ static let _protobuf_nameMap : SwiftProtobuf . _NameMap = [
69
+ 1 : . same( proto: " text " ) ,
70
+ ]
45
71
46
- /// Used by the decoding initializers in the SwiftProtobuf library, not generally
47
- /// used directly. `init(serializedData:)`, `init(jsonUTF8Data:)`, and other decoding
48
- /// initializers are defined in the SwiftProtobuf library. See the Message and
49
- /// Message+*Additions` files.
50
72
mutating func decodeMessage< D: SwiftProtobuf . Decoder > ( decoder: inout D ) throws {
51
73
while let fieldNumber = try decoder. nextFieldNumber ( ) {
52
74
switch fieldNumber {
@@ -56,32 +78,26 @@ struct Echo_EchoRequest: SwiftProtobuf.Message {
56
78
}
57
79
}
58
80
59
- /// Used by the encoding methods of the SwiftProtobuf library, not generally
60
- /// used directly. `Message.serializedData()`, `Message.jsonUTF8Data()`, and
61
- /// other serializer methods are defined in the SwiftProtobuf library. See the
62
- /// `Message` and `Message+*Additions` files.
63
81
func traverse< V: SwiftProtobuf . Visitor > ( visitor: inout V ) throws {
64
82
if !self . text. isEmpty {
65
83
try visitor. visitSingularStringField ( value: self . text, fieldNumber: 1 )
66
84
}
67
85
try unknownFields. traverse ( visitor: & visitor)
68
86
}
87
+
88
+ static func == ( lhs: Echo_EchoRequest , rhs: Echo_EchoRequest ) -> Bool {
89
+ if lhs. text != rhs. text { return false }
90
+ if lhs. unknownFields != rhs. unknownFields { return false }
91
+ return true
92
+ }
69
93
}
70
94
71
- struct Echo_EchoResponse : SwiftProtobuf . Message {
95
+ extension Echo_EchoResponse : SwiftProtobuf . Message , SwiftProtobuf . _MessageImplementationBase , SwiftProtobuf . _ProtoNameProviding {
72
96
static let protoMessageName : String = _protobuf_package + " .EchoResponse "
97
+ static let _protobuf_nameMap : SwiftProtobuf . _NameMap = [
98
+ 1 : . same( proto: " text " ) ,
99
+ ]
73
100
74
- /// The text of an echo response.
75
- var text : String = String ( )
76
-
77
- var unknownFields = SwiftProtobuf . UnknownStorage ( )
78
-
79
- init ( ) { }
80
-
81
- /// Used by the decoding initializers in the SwiftProtobuf library, not generally
82
- /// used directly. `init(serializedData:)`, `init(jsonUTF8Data:)`, and other decoding
83
- /// initializers are defined in the SwiftProtobuf library. See the Message and
84
- /// Message+*Additions` files.
85
101
mutating func decodeMessage< D: SwiftProtobuf . Decoder > ( decoder: inout D ) throws {
86
102
while let fieldNumber = try decoder. nextFieldNumber ( ) {
87
103
switch fieldNumber {
@@ -91,42 +107,16 @@ struct Echo_EchoResponse: SwiftProtobuf.Message {
91
107
}
92
108
}
93
109
94
- /// Used by the encoding methods of the SwiftProtobuf library, not generally
95
- /// used directly. `Message.serializedData()`, `Message.jsonUTF8Data()`, and
96
- /// other serializer methods are defined in the SwiftProtobuf library. See the
97
- /// `Message` and `Message+*Additions` files.
98
110
func traverse< V: SwiftProtobuf . Visitor > ( visitor: inout V ) throws {
99
111
if !self . text. isEmpty {
100
112
try visitor. visitSingularStringField ( value: self . text, fieldNumber: 1 )
101
113
}
102
114
try unknownFields. traverse ( visitor: & visitor)
103
115
}
104
- }
105
-
106
- // MARK: - Code below here is support for the SwiftProtobuf runtime.
107
-
108
- fileprivate let _protobuf_package = " echo "
109
-
110
- extension Echo_EchoRequest : SwiftProtobuf . _MessageImplementationBase , SwiftProtobuf . _ProtoNameProviding {
111
- static let _protobuf_nameMap : SwiftProtobuf . _NameMap = [
112
- 1 : . same( proto: " text " ) ,
113
- ]
114
-
115
- func _protobuf_generated_isEqualTo( other: Echo_EchoRequest ) -> Bool {
116
- if self . text != other. text { return false }
117
- if unknownFields != other. unknownFields { return false }
118
- return true
119
- }
120
- }
121
-
122
- extension Echo_EchoResponse : SwiftProtobuf . _MessageImplementationBase , SwiftProtobuf . _ProtoNameProviding {
123
- static let _protobuf_nameMap : SwiftProtobuf . _NameMap = [
124
- 1 : . same( proto: " text " ) ,
125
- ]
126
116
127
- func _protobuf_generated_isEqualTo ( other : Echo_EchoResponse ) -> Bool {
128
- if self . text != other . text { return false }
129
- if unknownFields != other . unknownFields { return false }
117
+ static func == ( lhs : Echo_EchoResponse , rhs : Echo_EchoResponse ) -> Bool {
118
+ if lhs . text != rhs . text { return false }
119
+ if lhs . unknownFields != rhs . unknownFields { return false }
130
120
return true
131
121
}
132
122
}
0 commit comments