Navigation Menu

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

Recently merged GAT RFC has some relevance to the API design #88

Closed
golddranks opened this issue Sep 11, 2017 · 3 comments
Closed

Recently merged GAT RFC has some relevance to the API design #88

golddranks opened this issue Sep 11, 2017 · 3 comments

Comments

@golddranks
Copy link
Contributor

golddranks commented Sep 11, 2017

Generic associated types landed just a little over week ago: rust-lang/rfcs#1598 They are still far away from stabilisation, but once they stabilise, they allow expressing the streaming iterator pattern as a trait. This crate also supports parsing in a streaming iterator style, using read_record and read_byte_record. Should some precautions be taken for later adding a trait-based streaming iterator API, or can the API added in a non-breaking way after 1.0?

@BurntSushi
Copy link
Owner

BurntSushi commented Sep 11, 2017

I'm not doing anything until I can actually play with it. If we need to release a 2.0, then so be it.

@golddranks
Copy link
Contributor Author

Okay, I'll close this. Let's see when the time is ripe :)

@golddranks golddranks changed the title Recently merged GAT RFC have some relevance to the API design Recently merged GAT RFC has some relevance to the API design Sep 11, 2017
@BurntSushi
Copy link
Owner

Sorry if I was curt earlier, I was just waking up. :-)

To be clearer, GAT could have an impact here, but it will take a bit I think before I'd be ready to let it into the public API. In particular, one the key advantages will be the existence of a streaming iterator abstraction, which will need to exist somewhere, and it most certainly won't start off life in std. Even if that did exist, the standard iterators in this API would still be around for some time since they work with Rust's for loop, which requires support in the language itself. The read_record APIs themselves are relatively convenient with while let syntax, so to make GATs compelling here, we'd probably want to hook into some other type of abstraction that permits composition of some kind.

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

2 participants