Skip to content

Feature: Seek + Write from VfsPath #35

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

Open
jalcine opened this issue Jul 14, 2022 · 2 comments · May be fixed by #36
Open

Feature: Seek + Write from VfsPath #35

jalcine opened this issue Jul 14, 2022 · 2 comments · May be fixed by #36

Comments

@jalcine
Copy link

jalcine commented Jul 14, 2022

I'm working on a union crate for this one and rusqlite that allows it to be used as the underlying storage. I have a branch that implements “random access”, which is vital for the SQLite implementation. I can see this being implemented in a way that would be optional for file systems that didn't support such an operation.

What are some things that are missing or could break here that'd prevent this from being made mainline? I could also see this being implemented as a trait for underlying VfsPathfile systems that also implement a means of producing random access files, so it'd fail at compile time.

(Originally published at: https://jacky.wtf/2022/7/lGgU)

@manuel-woelker
Copy link
Owner

Thanks for reaching out! Random access would indeed be a neat capability to have for a more complete feature set.

Ideally we should be catching random access on implementations that don't support it at compile time. On the other hand this might make ergonomics more complex, and make filesystems with "mixed" support more awkward to handle.

Another option might to hide seekability behind a feature, though that might also not be ideal from an ergonomics and discoverability perspective.

For now I think this looks like a good MVP. One thing that would be pretty neat is to have a basic test coverage of the update_file() function, to ensure that implementations behave in a predicatable way.

Would you be willing to create a pull request?

@jalcine jalcine linked a pull request Jul 18, 2022 that will close this issue
@jalcine
Copy link
Author

jalcine commented Jul 18, 2022

I agree re: the ergonomics of things. I think I can experiment with extension-style traits to allow a conventional VfsPath "upgrade" to one that is seekable if the underlying VfsPath implements and able to support it.

That I can! I've opened it at @manuel-woelker/rust-vfs/pull/36

(Originally published at: https://jacky.wtf/2022/7/ZIUy)

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

Successfully merging a pull request may close this issue.

2 participants