Ji-Xinyou commented on PR #2329: URL: https://github.com/apache/incubator-opendal/pull/2329#issuecomment-1563970177
> `opendal_kv` is not a good name to me as it confused with existing features inside opendal, so does `opendal_map`. > > How about API like the following: > > ```c > struct opendal_operator_builder *options = opendal_operator_builder_new(); > opendal_operator_builder_set(options, "a", "x"); > opendal_operator_builder_set(options, "b", "y"); > opendal_operator_builder_set(options, "c", "z"); > opendal_operator_ptr ptr = opendal_operator_new(options); > ``` > > Can we implement the `move` semantic in Rust for freeing `opendal_operator_builder` in `opendal_operator_new`? IMO the builder is different from this map approach, I think `opendal_operator_options` may be a good name. For the move semantic, it is not a common approach in C, usually if user manually allocates a heap memory, the user has to free it himself. (If we free the heap memory in our function, a programmer who often programs in C would probably double free the memory). -- 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]
