-
Notifications
You must be signed in to change notification settings - Fork 13
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
Mutability of sub-buffers #29
Comments
You raise an interesting point Volker. I don't know a Rust pattern for handling this situation either. |
A colleague of mine pointed me to https://docs.rs/bytes/1.0.1/bytes/index.html. I then also started to prepare a minimal example, to make the problem easier to understand for people that are not into OpenCl: https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=2f92e740e64e415dc46474fc397da96f. It doesn't compile and it made me realize how things in pure Rust, without the FFI border would be. So perhaps there needs to be a wrapper around One way could be to replace the |
Thank you Volker. |
In my code I write to a sub-buffer. Due to #27 this sub-buffer needs to be mutable. The buffer the sub-buffer is created from via
Buffer::create_sub_buffer()
doesn't need (in the Rust type system sense) to be mutable. Though it actually mutates.I haven't encountered such a case myself in Rust yet, so I don't know if there are any good patterns how those things are usually solved.
This issue isn't really actionable, but I wanted to bring it up, in case someone has a good idea. So feel free to close the issue as "won't fix".
The text was updated successfully, but these errors were encountered: