slbotbm commented on code in PR #4022:
URL: https://github.com/apache/iggy/pull/4022#discussion_r3991301869


##########
foreign/cpp/tests/unit/unit_tests.cpp:
##########
@@ -187,18 +366,6 @@ TEST(IggyExceptionTest, StoresMessage) {
     EXPECT_EQ(std::string(from_string.what()), message);
 }

Review Comment:
   done



##########
foreign/cpp/include/iggy.hpp:
##########
@@ -366,54 +1571,32 @@ inline rust::Vec<std::uint8_t> to_key_bytes(const 
std::string_view key) {
     return bytes;
 }
 
-inline iggy::ffi::HeaderField to_header_field(const iggy::ffi::HeaderKind 
kind, rust::Vec<std::uint8_t> value) {
-    iggy::ffi::HeaderField field{};
-    field.kind  = static_cast<std::uint8_t>(kind);
-    field.value = std::move(value);
-
-    return field;
-}
-
 /// An option key is always `String`-kinded. Only the value kind varies per 
key.
-inline iggy::ffi::HeaderEntry to_option_entry(const std::string_view key,
-                                              const iggy::ffi::HeaderKind 
value_kind,
-                                              rust::Vec<std::uint8_t> value) {
-    iggy::ffi::HeaderEntry entry{};
-    entry.key   = to_header_field(iggy::ffi::HeaderKind::String, 
to_key_bytes(key));
-    entry.value = to_header_field(value_kind, std::move(value));
-
-    return entry;
+inline HeaderEntry to_option_entry(const std::string_view key,
+                                   const HeaderKind value_kind,
+                                   std::vector<std::uint8_t> value) {
+    return HeaderEntry::Create(HeaderField::Create(HeaderKind::String, 
to_key_bytes(key)),
+                               HeaderField::Create(value_kind, 
std::move(value)));
 }
 
 }  // namespace detail
 
-enum class Durability { Replicated, Persisted };
-
-constexpr std::string_view to_string(const Durability durability) {
-    switch (durability) {
-        case Durability::Replicated:
-            return "replicated";
-        case Durability::Persisted:
-            return "persisted";
-    }
-    throw std::invalid_argument("Unknown durability");
-}
-
 /**
- * @brief Creates topic option entries for `Client::create_topic(...)`.
+ * @brief Creates catalog entries for ResourceOptions::Explicit().
  *
  * Each factory encodes one key from the server's topic option catalog using
  * that key's required value kind. The server rejects unknown keys and values
  * encoded with a different kind.
  *
- * Use `Client::describe_options("topic")` to retrieve the supported keys,
- * value kinds, and defaults. Binary transport errors do not identify a 
rejected
- * key, so the catalog is the discovery mechanism for those transports.
+ * For example, pass
+ * `ResourceOptions::Explicit({TopicOption::SegmentSize(1024 * 1024)})` to

Review Comment:
   done



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to