Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add object-safe traits for File, Filesystem, Storage
The Storage trait is not object safe, and the File and Filesystem struct have the Storage implementation as a type parameter. This can make it hard to write code that works with multiple storage implementations, and it can also lead to increased binary size as the filesystem operations are monomorphized for all storage implementations. This patch introduces three new traits, DynFile, DynFilesystem and DynStorage, that are object-safe wrappers for the File, Filesystem and Storage types. Some functionality cannot be expressed directly in these traits and is moved into helper functions instead, e. g. callbacks with arbitrary return types or methods using const generics.
- Loading branch information