refactor(fuse): reach Drive through a DriveApi trait

`Core` held a concrete `ProtonDriveClient`, so no test could make Drive
answer late, answer stale or not answer. This is the first step of
phase 0 in docs/MILESTONE-3.0.0.md.

`DriveApi` (`crates/pdfs-fuse/src/drive.rs`) covers the calls the sync
core makes: listings, events, creates, uploads, downloads, renames,
moves, trashes and restores. `ProtonDriveClient` implements it by
forwarding. `Core::drive` holds it, and every call of those methods now
goes through it. Sharing, Photos, devices, invitations and public links
stay on `Core::client`.

The trait takes readers and writers as trait objects, and
`impl dyn DriveApi` puts the client's generic signatures back, so call
sites read the same. Block reads go through `RevisionRead` instead of
the SDK's `RevisionReader`, which only the SDK can construct.

No behaviour change.
This commit is contained in:
nvrl committed 2026-10-03 04:37:37 +02:00
1 parent 8d92c69279
commit c73d5c9436
19 files changed
+560 -100

No files matched your search

Generated
+1
View File
@@ -3515,6 +3515,7 @@ dependencies = [
name = "pdfs-fuse"
version = "2.8.2"
dependencies = [
"async-trait",
"base64 0.23.1",
"fuser",
"futures",