Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Match the public and private APIs for content reading (#386)
`wnfs` changes: - Made the length param optional and renamed the offset param to match the public side. - Copied the doc test from the public side to the private side. - Made it so that `PrivateFile.get_content` uses its `read_at` method. - Added `PublicFile.get_content` to reflect the private side. - Made `PrivateFile.read_at` take `byte_offset` as `u64` instead of `usize` `wnfs-wasm` changes: - Added `PrivateFile.read_at` - Made it so that `PrivateFile.get_content` uses its `read_at` method. - Added `PublicFile.get_content` - Adjusted tests to use new and changed methods. --- * refactor: (wnfs) make PrivateFile.read_at's length param an option to reflect the public side * refactor: `get_content` should use `read_at` and add `get_content` to `PublicFile` * feat: (wnfs-wasm) add `read_at` to `PrivateFile` and add `get_content` to `PublicFile` * refactor: (wnfs) use u64 type for block indexes * fix: (wnfs-wasm) adjust to new `read_at` `byte_offset` param type * Apply suggestions from code review Co-authored-by: Philipp Krüger <philipp.krueger1@gmail.com> Signed-off-by: Steven Vandevelde <steven.vandevelde@hey.com> * refactor: make `offset` a `u64` in `can_read_section_of_file` * fix: remove unstable let expression --------- Signed-off-by: Steven Vandevelde <steven.vandevelde@hey.com> Co-authored-by: Philipp Krüger <philipp.krueger1@gmail.com>
- Loading branch information