workers-rs
workers-rs copied to clipboard
[Feature] Cf Kv batch get request
Is there an existing issue for this?
- [x] I have searched the existing issues
Description
The cf kv api support batch get since April. And it will be really helpful if we supports that.
I think a good api design will be changing this line
pub fn get(&self, name: &str) -> GetOptionsBuilder {
to
pub fn get(&self, name: &[&str]) -> GetOptionsBuilder {
Since the "Request multiple keys" api does not support arrayBuffer and stream, the api will be a bit different
I can think of four possible implementation, tell me which one is preferred lol
- separate function, just add a new function called
batch_getorbatch_readwith a separate builder - same function, but generic with type deduction (if input is a array slice, it will be returning a batch request builder)
- the value_type setter return an error (this will be a breaking change though)
- add a new variant to
KvError, this will also be somehow breaking since we did not attribute it withnon_exhaustive