|
| 1 | +// DO NOT EDIT. |
| 2 | +// swift-format-ignore-file |
| 3 | +// |
| 4 | +// Generated by the Swift generator plugin for the protocol buffer compiler. |
| 5 | +// Source: Sources/ImportsImportsAPublicly/imports_imports_a_publicly.proto |
| 6 | +// |
| 7 | +// For information on using the generated types, please see the documentation: |
| 8 | +// https://github.com/apple/swift-protobuf/ |
| 9 | + |
| 10 | +import Foundation |
| 11 | +import SwiftProtobuf |
| 12 | + |
| 13 | +import ImportsAPublicly |
| 14 | +import ModuleA |
| 15 | + |
| 16 | +// If the compiler emits an error on this type, it is because this file |
| 17 | +// was generated by a version of the `protoc` Swift plug-in that is |
| 18 | +// incompatible with the version of SwiftProtobuf to which you are linking. |
| 19 | +// Please ensure that you are building against the same version of the API |
| 20 | +// that was used to generate this file. |
| 21 | +fileprivate struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAPIVersionCheck { |
| 22 | + struct _3: SwiftProtobuf.ProtobufAPIVersion_3 {} |
| 23 | + typealias Version = _3 |
| 24 | +} |
| 25 | + |
| 26 | +public struct ImportsImportsAPublicly: Sendable { |
| 27 | + // SwiftProtobuf.Message conformance is added in an extension below. See the |
| 28 | + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for |
| 29 | + // methods supported on all messages. |
| 30 | + |
| 31 | + public var a: ModuleA.A { |
| 32 | + get {return _a ?? ModuleA.A()} |
| 33 | + set {_a = newValue} |
| 34 | + } |
| 35 | + /// Returns true if `a` has been explicitly set. |
| 36 | + public var hasA: Bool {return self._a != nil} |
| 37 | + /// Clears the value of `a`. Subsequent reads from it will return its default value. |
| 38 | + public mutating func clearA() {self._a = nil} |
| 39 | + |
| 40 | + public var e: ModuleA.E { |
| 41 | + get {return _e ?? .unset} |
| 42 | + set {_e = newValue} |
| 43 | + } |
| 44 | + /// Returns true if `e` has been explicitly set. |
| 45 | + public var hasE: Bool {return self._e != nil} |
| 46 | + /// Clears the value of `e`. Subsequent reads from it will return its default value. |
| 47 | + public mutating func clearE() {self._e = nil} |
| 48 | + |
| 49 | + public var unknownFields = SwiftProtobuf.UnknownStorage() |
| 50 | + |
| 51 | + public init() {} |
| 52 | + |
| 53 | + fileprivate var _a: ModuleA.A? = nil |
| 54 | + fileprivate var _e: ModuleA.E? = nil |
| 55 | +} |
| 56 | + |
| 57 | +// MARK: - Code below here is support for the SwiftProtobuf runtime. |
| 58 | + |
| 59 | +extension ImportsImportsAPublicly: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { |
| 60 | + public static let protoMessageName: String = "ImportsImportsAPublicly" |
| 61 | + public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ |
| 62 | + 21: .same(proto: "a"), |
| 63 | + 22: .same(proto: "e"), |
| 64 | + ] |
| 65 | + |
| 66 | + public mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws { |
| 67 | + while let fieldNumber = try decoder.nextFieldNumber() { |
| 68 | + // The use of inline closures is to circumvent an issue where the compiler |
| 69 | + // allocates stack space for every case branch when no optimizations are |
| 70 | + // enabled. https://github.com/apple/swift-protobuf/issues/1034 |
| 71 | + switch fieldNumber { |
| 72 | + case 21: try { try decoder.decodeSingularMessageField(value: &self._a) }() |
| 73 | + case 22: try { try decoder.decodeSingularEnumField(value: &self._e) }() |
| 74 | + default: break |
| 75 | + } |
| 76 | + } |
| 77 | + } |
| 78 | + |
| 79 | + public func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws { |
| 80 | + // The use of inline closures is to circumvent an issue where the compiler |
| 81 | + // allocates stack space for every if/case branch local when no optimizations |
| 82 | + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and |
| 83 | + // https://github.com/apple/swift-protobuf/issues/1182 |
| 84 | + try { if let v = self._a { |
| 85 | + try visitor.visitSingularMessageField(value: v, fieldNumber: 21) |
| 86 | + } }() |
| 87 | + try { if let v = self._e { |
| 88 | + try visitor.visitSingularEnumField(value: v, fieldNumber: 22) |
| 89 | + } }() |
| 90 | + try unknownFields.traverse(visitor: &visitor) |
| 91 | + } |
| 92 | + |
| 93 | + public static func ==(lhs: ImportsImportsAPublicly, rhs: ImportsImportsAPublicly) -> Bool { |
| 94 | + if lhs._a != rhs._a {return false} |
| 95 | + if lhs._e != rhs._e {return false} |
| 96 | + if lhs.unknownFields != rhs.unknownFields {return false} |
| 97 | + return true |
| 98 | + } |
| 99 | +} |
0 commit comments