Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Iterator serialization support #160

Open
jprochazk opened this issue Jul 29, 2022 · 3 comments
Open

Iterator serialization support #160

jprochazk opened this issue Jul 29, 2022 · 3 comments

Comments

@jprochazk
Copy link

jprochazk commented Jul 29, 2022

This would offer greater flexibilty for serializing any array-like construct. For example, it would remove the need for intermediate allocations when transforming data before serializing it.

@tailhook
Copy link
Contributor

tailhook commented Aug 1, 2022

Unfortunately I don't think Rust coherence rules will allow that for QueryArg. But we may implement a derive with a flag, something like this:

#[derive(QueryArgs)]
struct MyArgs<'a> {
  #[query_arg(array_like)]
  queued_items: &'a Queue<String>,
}

@AdrienPensart
Copy link

Hello, by the way, do you have an example for

use edgedb_protocol::query_arg::QueryArgs;

#[derive(QueryArgs)]
struct MusicInput {
    pub artist: String
}

cannot find derive macro QueryArgs in this scope
Or do I have to implement it myself ? but how do you encode each field?

Thank you!

@tailhook
Copy link
Contributor

tailhook commented Aug 4, 2022

Yes, we don't have that derive macro yet. It's in the to do list.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants