commit | f56d15c2f320a6046ae7eab91c2e4fc6cf88f330 | [log] [tgz] |
---|---|---|
author | Mitchell Kember <mkember@google.com> | Wed May 27 23:03:21 2020 +0000 |
committer | CQ bot account: commit-bot@chromium.org <commit-bot@chromium.org> | Wed May 27 23:03:21 2020 +0000 |
tree | 37c1b6ab2cfeaa6e9d8b5d0ed7c7724064c56772 | |
parent | 370943b6ecd09869ca7647e9964aa3c24bcf4bfa [diff] |
[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>
Pink + Purple == Fuchsia (a new operating system)
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.
See Getting Started.
See fuchsia.dev.