[fidlgen_rust] Default implementations for transitional methods

This CL makes fidlgen_rust emit default implementations for
ProxyInterface methods if their corresponding FIDL protocol method is
marked [Transitional]. This makes it possible to add methods in a soft
transition without breaking uses of the ProxyInterface traits.

Context: If you have a FIDL protocol called Foo, the Rust bindings will
have a trait FooProxyInterface and a struct FooProxy implementing the
trait, which clients use to make async requests. Sometimes people will
implement FooProxyInterface for their own types, e.g. for FakeFooProxy
in unit tests. With this change, FakeFooProxy would continue to compile
if you add a transitional method to Foo.

The default implementations call unimplemented!(), which panics. They do
this, rather than e.g. returning a new fidl::Error variant, because
calling one of these methods is always a programmer error, not something
that makes sense to recover from.

In addition, this CL fixes the command for regenerating fidldoc goldens
in contributing_to_fidl.md and fidldoc/README.md:

* It must be invoked as host_x64/fidldoc_bin_test, not fidldoc_bin_test
* Must append -- golden_test, not --golden_test
* The REGENERATE_GOLDENS_FOLDER variable must be set to a particular
  value, not the unspecified value $FOLDER

Test: fx test host_x64/fidlgen_rust_test
Fixed: 52607
Change-Id: Ifa1b10149e583401f20e1eefcda99443f554961b
Reviewed-on: https://fuchsia-review.googlesource.com/c/fuchsia/+/392258
Commit-Queue: Mitchell Kember <mkember@google.com>
Reviewed-by: Pascal Perez <pascallouis@google.com>
Reviewed-by: Felix Zhu <fcz@google.com>
Testability-Review: Felix Zhu <fcz@google.com>
19 files changed
tree: 37c1b6ab2cfeaa6e9d8b5d0ed7c7724064c56772
  1. boards/
  2. build/
  3. bundles/
  4. cts/
  5. docs/
  6. examples/
  7. garnet/
  8. products/
  9. scripts/
  10. sdk/
  11. src/
  12. third_party/
  13. tools/
  14. zircon/
  15. .clang-format
  16. .clang-tidy
  17. .dir-locals.el
  18. .gitattributes
  19. .gitignore
  20. .gn
  21. .style.yapf
  22. AUTHORS
  23. BUILD.gn
  24. CODE_OF_CONDUCT.md
  25. CONTRIBUTING.md
  26. LICENSE
  27. OWNERS
  28. PATENTS
  29. README.md
  30. rustfmt.toml
README.md

Fuchsia

Pink + Purple == Fuchsia (a new operating system)

What is Fuchsia?

Fuchsia is a modular, capability-based operating system. Fuchsia runs on modern 64-bit Intel and ARM processors.

Fuchsia is an open source project with a code of conduct that we expect everyone who interacts with the project to respect.

How can I build and run Fuchsia?

See Getting Started.

Where can I learn more about Fuchsia?

See fuchsia.dev.