-
Notifications
You must be signed in to change notification settings - Fork 96
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
Should mutable borrow of RasterBand require mutable borrow of it's Dataset? #150
Comments
This is a very interesting question. I don't have a good answer, but want to highlight a few points to discuss:
Fortunately, |
The standard library File is a good example to base our decision on. It is also a wrapper around a handle, and makes system calls for the actual operations. See in particular File::set_len which modifies the underlying file structure, but takes
Thus, we should be in the clear to simply use Another option, is to use the compiler to enforce some semantics:
I like this as it may help avoid some pitfals at compile-time. It is also minimal conceptual change from current code-base, as we anyway use let ds = Dataset::open(...);
let band = ds.rasterband(1)?;
let same_band = ds.rasterband(1)?; |
thanks for looking this up. This is a very good overview and File is a matching example. I guess we should do the read, write separation? |
Open Question from #144
The text was updated successfully, but these errors were encountered: