Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
all: Split Filesystem trait by Hierarchy/Copier and move errors into …
…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