rust-indexed-db icon indicating copy to clipboard operation
rust-indexed-db copied to clipboard

Provide a `IdbCursorWithValue::into_vec_values`

Open FirelightFlagboy opened this issue 1 year ago • 1 comments

Currently IdbCursorWithValue provide into_vec method that return a Vec containing the Key-Value pair.

I would like to have something similar that only return the value. Given the implentation of into_vec it seems doable to have something that return directly the self.value() in the mapper of handle_into_vec.

If it's fine for you, I could provide a PR

FirelightFlagboy avatar Jul 30 '24 08:07 FirelightFlagboy

Hey, I'm currently rewriting a lot of the crate so I'd avoid making new PRs in the meantime - I'll just take this into account when the PR for that is finally up. I only quickly glanced over the issue and source code just now so might be missing the mark here, but I think the issue might end up just getting closed as part of the redesign.

State of the library now:

  • Essentially just turns Javascript requests with success/error events into Rust futures
  • Still largely working with JS types
  • Still feels like Rust bindings for a JS API

State I intend:

  • Feels like an API written in and designed for Rust
  • JS types only really exposed in catch-all type errors
  • Integrates with serde for storing/reading objects instead of JS primitives
  • Better integration with the Rust ecosystem, e.g. implementing streams for cursors

Alorel avatar Jul 31 '24 08:07 Alorel

@FirelightFlagboy Your request will be getting implemented indirectly - #40 is getting merged in the next couple of days unless I spot something horribly wrong and, with it, cursors will implement Stream and, by extension, TryStreamExt - it'll allow you to do any sort of manipulation you need.

Alorel avatar Oct 27 '24 03:10 Alorel

This issue has been included in v0.6.0 :tada:

- Your friendly neighbourhood :robot: semantic release bot

Alorel avatar Oct 27 '24 13:10 Alorel