The map construction in opendal's C binding #1904
Closed
xyjixyjixyji
started this conversation in
Ideas
Replies: 2 comments 8 replies
-
We don't need to support map constrution for c binding. I expect to see something like AWS SDK CPP: Aws::Client::ClientConfiguration clientConfig;
clientConfig.proxyHost = "localhost";
clientConfig.proxyPort = 1234;
clientConfig.proxyScheme = Aws::Http::Scheme::HTTPS;
Aws::S3::S3Client(clientConfig); Since we have so many binding and services to support, maybe we should do some codegen work. |
Beta Was this translation helpful? Give feedback.
8 replies
-
Then the discussion could be closed. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
In opendal, we use a
HashMap<String, String>
to support our init logic. But sinceHashMap
is pretty complex to express and not a C native type, we need to be careful about it.I currently have several ideas on how the C binding could construct the required
HashMap
, and really appreciate any suggestions or ideas on this topic.HashMap
thing to the user, the API will be like the followingThis API will reads keys and values and make a
HashMap
inside Rust code without exposing to users, but this will require user to make sure that thekeys
andvalues
are in correct order. Moreover, the parameters are with less semantics.e.g.
is ok but
is semantically not ok and often not detectable.
And
is not grammarly ok.
HashMap
by providing API likeTo control the behavior of opendal_map, we can expose limited API.
The disadvantage of this will be opendal C binding will be less native, since it relies on part of the Rust std, and the advantage will be it will allow for further operation like
read
andinsert
to it.Again, I would like to hear everyone's opinions on the things above or any other possible implementation.
Beta Was this translation helpful? Give feedback.
All reactions