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

Use Cow to make this fully Iterator compliant #4

Open
flo-l opened this issue May 1, 2016 · 6 comments
Open

Use Cow to make this fully Iterator compliant #4

flo-l opened this issue May 1, 2016 · 6 comments

Comments

@flo-l
Copy link
Owner

flo-l commented May 1, 2016

Just leaving this here as a note to myself.

@flo-l
Copy link
Owner Author

flo-l commented May 1, 2016

@flo-l
Copy link
Owner Author

flo-l commented May 1, 2016

using this would give users cheap immutable references to the original data and clones if they use multiple windows.

maybe a custom Cow like smartpointer or a wrapper is needed. One which can be turned into a Clone as soon as two of them exist simultaneously

@flo-l
Copy link
Owner Author

flo-l commented May 1, 2016

the window smartpointer needs either a negative send bound or some sort of synchronization

@flo-l
Copy link
Owner Author

flo-l commented May 1, 2016

what should be done if mutation happens while another, overlapping window is still reachable?

@flo-l
Copy link
Owner Author

flo-l commented May 2, 2016

it's not possible to clone the older window as soon as another one gets spawned by next(), because window derefs to (maybe multiple) references, which cannot be changed.

Instead one could create another storage vec and store the new and following windows there. But that's a performance nightmare..

@flo-l
Copy link
Owner Author

flo-l commented Jun 16, 2017

Derefs are gone with v3.0, maybe it's possible now

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

1 participant