| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697 |
- // DO NOT EDIT.
- // swift-format-ignore-file
- // swiftlint:disable all
- //
- // Generated by the Swift generator plugin for the protocol buffer compiler.
- // Source: SomeProtoWithBytes.proto
- //
- // For information on using the generated types, please see the documentation:
- // https://github.com/apple/swift-protobuf/
- public import Foundation
- public import SwiftProtobuf
- // If the compiler emits an error on this type, it is because this file
- // was generated by a version of the `protoc` Swift plug-in that is
- // incompatible with the version of SwiftProtobuf to which you are linking.
- // Please ensure that you are building against the same version of the API
- // that was used to generate this file.
- fileprivate struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAPIVersionCheck {
- struct _2: SwiftProtobuf.ProtobufAPIVersion_2 {}
- typealias Version = _2
- }
- public struct SomeProtoWithBytes: @unchecked Sendable {
- // SwiftProtobuf.Message conformance is added in an extension below. See the
- // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
- // methods supported on all messages.
- public var someBytes: Data {
- get {return _someBytes ?? Data()}
- set {_someBytes = newValue}
- }
- /// Returns true if `someBytes` has been explicitly set.
- public var hasSomeBytes: Bool {return self._someBytes != nil}
- /// Clears the value of `someBytes`. Subsequent reads from it will return its default value.
- public mutating func clearSomeBytes() {self._someBytes = nil}
- public var extStr: String {
- get {return _extStr ?? String()}
- set {_extStr = newValue}
- }
- /// Returns true if `extStr` has been explicitly set.
- public var hasExtStr: Bool {return self._extStr != nil}
- /// Clears the value of `extStr`. Subsequent reads from it will return its default value.
- public mutating func clearExtStr() {self._extStr = nil}
- public var unknownFields = SwiftProtobuf.UnknownStorage()
- public init() {}
- fileprivate var _someBytes: Data? = nil
- fileprivate var _extStr: String? = nil
- }
- // MARK: - Code below here is support for the SwiftProtobuf runtime.
- extension SomeProtoWithBytes: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
- public static let protoMessageName: String = "SomeProtoWithBytes"
- public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
- 2: .same(proto: "someBytes"),
- 100: .standard(proto: "ext_str"),
- ]
- public mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
- while let fieldNumber = try decoder.nextFieldNumber() {
- // The use of inline closures is to circumvent an issue where the compiler
- // allocates stack space for every case branch when no optimizations are
- // enabled. https://github.com/apple/swift-protobuf/issues/1034
- switch fieldNumber {
- case 2: try { try decoder.decodeSingularBytesField(value: &self._someBytes) }()
- case 100: try { try decoder.decodeSingularStringField(value: &self._extStr) }()
- default: break
- }
- }
- }
- public func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
- // The use of inline closures is to circumvent an issue where the compiler
- // allocates stack space for every if/case branch local when no optimizations
- // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and
- // https://github.com/apple/swift-protobuf/issues/1182
- try { if let v = self._someBytes {
- try visitor.visitSingularBytesField(value: v, fieldNumber: 2)
- } }()
- try { if let v = self._extStr {
- try visitor.visitSingularStringField(value: v, fieldNumber: 100)
- } }()
- try unknownFields.traverse(visitor: &visitor)
- }
- public static func ==(lhs: SomeProtoWithBytes, rhs: SomeProtoWithBytes) -> Bool {
- if lhs._someBytes != rhs._someBytes {return false}
- if lhs._extStr != rhs._extStr {return false}
- if lhs.unknownFields != rhs.unknownFields {return false}
- return true
- }
- }
|