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

impl FileExt for NbdClient #3

Open
asomers opened this issue Jun 19, 2020 · 4 comments
Open

impl FileExt for NbdClient #3

asomers opened this issue Jun 19, 2020 · 4 comments

Comments

@asomers
Copy link

asomers commented Jun 19, 2020

Would it be possible to implement FileExt for NbdClient? That way consumers could do a single read_exact_at instead of a seek followed by read_exact.

@vi
Copy link
Owner

vi commented Jun 19, 2020

Probably. Do you mean both std::os::windows::fs::FileExt and std::os::unix::fs::FileExt or just one of them? Maybe there is some crate with platform-independent abstraction of read_at?

A pull request is welcome.

@vi
Copy link
Owner

vi commented Jun 19, 2020

Maybe better implement positioned_io::ReadAt or buffered_offset_reader::OffsetReadMut (or both)?

@asomers
Copy link
Author

asomers commented Jul 3, 2020

Well, I was only thinking about unix. Does anybody even use NBD on Windows?

@vi
Copy link
Owner

vi commented Jul 3, 2020

Does anybody even use NBD on Windows?

I remember trying to use in-memory NBD server running on Windows as a swap-file on Linux.

(Nothing good happened from that attempt although)


I've published read_write_at that intents to be a central place for "read/write with offset" abstraction. I'm going to implement read_write_at::ReadWriteAtMut for NBD client and maybe integrate it somehow with the server as well.

Maybe there will be a wrapper for FileExt as well in read_write_at v0.2.

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

2 participants