Skip to content

Commit

Permalink
all: Split Filesystem trait by Hierarchy/Copier and move errors into …
Browse files Browse the repository at this point in the history
…associated types (#108)

The Filesystem trait encompasses both reading filesystem metadata (i.e.
hierarchy) and copying data into block devices. The former does not
depend on the latter, and does not even require knowing any information
about the block device type, which makes extending the filesystem to
multiple devices difficult.

This is evident in the old design in `copy_file_buf`, which is
essentially a filesystem copier into a `&mut [u8]`. Since Filesystem
must supply both hierarchy and copying functions, this had to be
separate.

In the new design, filesystems need only implement FilesystemHierarchy,
and can implement as many FilesystemCopiers as needed for individual
block device types.

This also overhauls error handling to use associated types, cleaning up
signatures, and error enums keep better track of where the error
occurred (e.g. in the hierarchy vs copier, or in the block device).
  • Loading branch information
antangelo authored Feb 3, 2025
1 parent 8692b41 commit ed1abc7
Show file tree
Hide file tree
Showing 34 changed files with 1,791 additions and 1,153 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ name: Check
jobs:
check:
name: Check and lint
runs-on: ubuntu-latest
runs-on: ubuntu-22.04 # FIXME: 24.04 missing libwebkit2gtk-4, required for Tauri
steps:
- name: Checkout source
uses: actions/checkout@v3
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ jobs:
run: zip -j xdvdfs-linux-${{ github.sha }}.zip LICENSE target/release/xdvdfs

- name: Upload artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: xdvdfs-linux-${{ github.sha }}
path: xdvdfs-linux-${{ github.sha }}.zip
Expand Down Expand Up @@ -89,7 +89,7 @@ jobs:
run: zip -j xdvdfs-windows-${{ github.sha }}.zip LICENSE target/x86_64-pc-windows-gnu/release/xdvdfs.exe

- name: Upload artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: xdvdfs-windows-${{ github.sha }}
path: xdvdfs-windows-${{ github.sha }}.zip
Expand Down Expand Up @@ -123,7 +123,7 @@ jobs:
working-directory: ./xdvdfs-web

- name: Upload artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: xdvdfs-web-${{ github.sha }}
path: xdvdfs-web/xdvdfs-web-${{ github.sha }}.zip
Expand Down Expand Up @@ -162,7 +162,7 @@ jobs:
projectPath: ./xdvdfs-desktop

- name: Upload Artifacts
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: xdvdfs-desktop-${{ matrix.platform }}-${{ github.sha }}
path: |
Expand Down
Loading

0 comments on commit ed1abc7

Please sign in to comment.