Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
CHANGES.md
if knowledge of this change could be valuable to users.I mapped the methods
VSIFileFromMemBuffer
,VSIUnlink
,VSIGetMemFileBuffer
.Since I haven't found a good place to put them, I created a new
vsi
module in the root.There are two methods for creation and retrieval that work with owned data, such that either we give the ownership from our Rust object to GDAL's CPP context or vice versa.
Moreover, there are two methods that work with references and they do not hand over ownership. This is more complicated since we don't want to introduce memory leaks. I created a retrieval method that only gets a function so that we do not hand out data but only a computation result from the function. For creation, I introduced a
MemFileRef
struct that handles the lifetime to the referenced data.It would be nice if someone would check that my solution makes sense in that case.