[vfs][rust] Refactor VmoFile

Implement VmoFile in terms of File and remove duplicated connection
handling logic. Remove use of generics for VmoFile struct by using
dynamic dispatch for asynchronous construction via delegate trait.
This improves compile times and allows for both synchronous and
asynchronous use of VmoFile from the same type.

Allow construction of a VmoFile from an existing Vmo. Remove now
redundant ReadOnlyVmoFile.

Enforce seek offset consistency for files using the Rust VFS. This
ensures seeking past 2^64 - 1 bytes will result in OUT_OF_RANGE rather
than silent truncation. This behavior is still not consistent with that
defined in http://fxbug.dev/100754 but ensures the internal state
remains valid.

Bug: 99448
Test: fx test vfs-tests
  fuchsia-pkg://fuchsia.com/rustvfs-io1-conformance-test
Change-Id: I915e5ca25677be54d6bbe5905f8b770ec3a2b86c
Reviewed-on: https://fuchsia-review.googlesource.com/c/fuchsia/+/679622
Reviewed-by: Tamir Duberstein <tamird@google.com>
Reviewed-by: Stephen Demos <sdemos@google.com>
Commit-Queue: Brandon Castellano <bcastell@google.com>
11 files changed
tree: 101303cb483eb45eb79673fa1fea1564bc20b2ad
  1. boards/
  2. build/
  3. bundles/
  4. docs/
  5. examples/
  6. products/
  7. scripts/
  8. sdk/
  9. src/
  10. third_party/
  11. tools/
  12. zircon/
  13. .clang-format
  14. .clang-tidy
  15. .editorconfig
  16. .git-blame-ignore-revs
  17. .gitattributes
  18. .gitignore
  19. .gitmodules
  20. .gn
  21. .style.yapf
  22. analysis_options.yaml
  23. AUTHORS
  24. BUILD.gn
  25. CODE_OF_CONDUCT.md
  26. CONTRIBUTING.md
  27. fuchsia.code-workspace
  28. LICENSE
  29. OWNERS
  30. PATENTS
  31. pyrightconfig.json
  32. README.md
  33. rustfmt.toml
README.md

Fuchsia

What is Fuchsia?

Fuchsia is an open source, general purpose operating system supporting modern 64-bit Intel and ARM processors.

We expect everyone interacting with our project to respect our code of conduct.

Read more about Fuchsia's principles.

How can I build and run Fuchsia?

See Getting Started.

Where can I learn more about Fuchsia?

See fuchsia.dev.