[fidl][cpp] Start of natural sync calls

Adds fidl::SyncClient and fidl::Call following the sketch in
https://fuchsia.googlesource.com/fuchsia/+/refs/heads/main/src/lib/fidl/cpp/docs/structure-of-unified-cpp-fidl-bindings.md#natural-api_synchronous.

We already have two code paths for making a synchronous call, one for
Zircon channel (which requires the caller to provide storage), and
another for driver (whose messages bring along an arena for storage).
Those code paths also automatically decode the message as part of the
call, which doesn't work for natural types with their own decoding
logic.

To not end up with 4 different code paths (whether caller provides
storage X whether decoding is in-place), this CL starts a generalized
storage concept, outlined below:

- OutgoingMessage::Call always takes a MessageStorageViewBase*.
- For a Zircon channel, the caller passes ChannelMessageStorageView,
  which references some buffer span and handle spans.
- For a driver channel, the caller will pass a DriverStorageView,
  which references a |fdf::Arena*| that can hold the received arena
  backing the received message. (To be added in a future CL).
- No more auto-decoding within OutgoingMessage::Call. Both wire types
  and natural types will be symmetrical and each add their own decoding
  logic afterwards.

Because the change cuts across bprosnitz@'s generated code serialization
changes, I did not migrate every existing usage of
OutgoingMessage::Call to the new code path. That will follow once we've
landed the big encoding/decoding changes.

Bug: 60240
Bug: 100472
Change-Id: I6318021ebfe9b677b4801c7ea9d650272ce88a54
Reviewed-on: https://fuchsia-review.googlesource.com/c/fuchsia/+/679151
Reviewed-by: Benjamin Prosnitz <bprosnitz@google.com>
Commit-Queue: Yifei Teng <yifeit@google.com>
86 files changed
tree: 2b7c4a19954fc673e3c4b57baeef7989f159425f
  1. boards/
  2. build/
  3. bundles/
  4. docs/
  5. examples/
  6. garnet/
  7. products/
  8. scripts/
  9. sdk/
  10. src/
  11. third_party/
  12. tools/
  13. zircon/
  14. .clang-format
  15. .clang-tidy
  16. .editorconfig
  17. .git-blame-ignore-revs
  18. .gitattributes
  19. .gitignore
  20. .gn
  21. .style.yapf
  22. analysis_options.yaml
  23. AUTHORS
  24. BUILD.gn
  25. CODE_OF_CONDUCT.md
  26. CONTRIBUTING.md
  27. LICENSE
  28. OWNERS
  29. PATENTS
  30. pyrightconfig.json
  31. README.md
  32. 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.