]> git.proxmox.com Git - pxar.git/commit
make ReadAt trait more correct
authorWolfgang Bumiller <w.bumiller@proxmox.com>
Wed, 24 Jun 2020 08:11:41 +0000 (10:11 +0200)
committerWolfgang Bumiller <w.bumiller@proxmox.com>
Wed, 24 Jun 2020 09:53:32 +0000 (11:53 +0200)
commite72062a97a35608539cb171b96296105bd830299
treef4e9adc1c9b2481320f3b701c7f17f0e18421060
parent4af159447309ba6a5c786bc192c880e94dfb5b48
make ReadAt trait more correct

A simple `poll_read_at` with an immutable self reference
lacks the information which poll *operation* is being
polled. An associated type won't work well enough
(particularly with trait objects and lifetimes), and GATs
are unstable (and not advanced enough yet), so we need to
improvise.

To be more async-friendly, the `start_read_at()` method's
Pending now includes a reference to the operation which also
grabs the buffer lifetime, and has to be completed with
`poll_complete()`.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
src/accessor/aio.rs
src/accessor/mod.rs
src/accessor/read_at.rs [new file with mode: 0644]
src/accessor/sync.rs
src/util.rs