imports_a_publicly.pb.swift 3.9 KB

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