1 // Protocol Buffers - Google's data interchange format 2 // Copyright 2024 Google LLC. All rights reserved. 3 // 4 // Use of this source code is governed by a BSD-style 5 // license that can be found in the LICENSE file or at 6 // https://developers.google.com/open-source/licenses/bsd 7 8 #ifndef GOOGLE_PROTOBUF_COMPILER_RUST_ACCESSORS_WITH_PRESENCE_H__ 9 #define GOOGLE_PROTOBUF_COMPILER_RUST_ACCESSORS_WITH_PRESENCE_H__ 10 11 #include "google/protobuf/compiler/rust/accessors/accessor_case.h" 12 #include "google/protobuf/compiler/rust/context.h" 13 #include "google/protobuf/descriptor.h" 14 15 // Helper functions for generating the common accessors that any with-presence 16 // field have (the hassers, clearers, and the Optional<> getter). 17 18 namespace google { 19 namespace protobuf { 20 namespace compiler { 21 namespace rust { 22 23 void WithPresenceAccessorsInMsgImpl(Context& ctx, const FieldDescriptor& field, 24 AccessorCase accessor_case); 25 26 void WithPresenceAccessorsInExternC(Context& ctx, const FieldDescriptor& field); 27 28 void WithPresenceAccessorsInThunkCc(Context& ctx, const FieldDescriptor& field); 29 30 } // namespace rust 31 } // namespace compiler 32 } // namespace protobuf 33 } // namespace google 34 35 #endif // GOOGLE_PROTOBUF_COMPILER_RUST_ACCESSORS_WITH_PRESENCE_H__ 36