[fidl][rust] Use fidl_struct_copy! macro where possible

fidl_struct_copy! is a new rust macro that directly copies structs when:
- There is no padding
- The struct entirely consists of primitives and structs consisting of
primitives (recursively)

It is potentially possible to extend this to structs containing arrays,
which would be useful for types like MessageHeader but it is not
currently supported by zerocopy.

This reduces binary size by 20480 bytes

Summary of performance change: (others have small percentage difference)
Rust/Decode/MessageHeader/WallTime                                                       faster            0.462-0.471    80.88 +/- 0.12 ns     37.76 +/- 0.30 ns
Rust/Decode/StructField/16/WallTime                                                      faster            0.198-0.203    186.24 +/- 0.13 ns    37.27 +/- 0.46 ns
Rust/Decode/StructField/256/WallTime                                                     faster            0.019-0.021    2813 +/- 12 ns        56.7 +/- 1.8 ns
Rust/Decode/StructTree/Depth8/WallTime                                                   faster            0.010-0.011    5571.7 +/- 7.9 ns     58.3 +/- 1.3 ns
Rust/Encode/MessageHeader/WallTime                                                       faster            0.608-0.617    87.73 +/- 0.38 ns     53.76 +/- 0.17 ns
Rust/Encode/StructField/16/WallTime                                                      faster            0.334-0.338    166.90 +/- 0.33 ns    56.06 +/- 0.26 ns
Rust/Encode/StructField/256/WallTime                                                     faster            0.033-0.034    1908.4 +/- 3.5 ns     63.99 +/- 0.24 ns
Rust/Encode/StructTree/Depth8/WallTime                                                   faster            0.021-0.021    3002.8 +/- 2.9 ns     62.66 +/- 0.29 ns


Test: existing rust conformance tests

Change-Id: I2ca8eb624b36011f0835e09a207fb3d62d626b48
Reviewed-on: https://fuchsia-review.googlesource.com/c/fuchsia/+/403333
Reviewed-by: Tyler Mandry <tmandry@google.com>
Reviewed-by: Mitchell Kember <mkember@google.com>
Commit-Queue: Benjamin Prosnitz <bprosnitz@google.com>
Testability-Review: Mitchell Kember <mkember@google.com>
35 files changed
tree: a8107bd1cfc1a0f476ae539db8819f6dd10b0794
  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. .gitattributes
  18. .gitignore
  19. .gn
  20. .style.yapf
  21. AUTHORS
  22. BUILD.gn
  23. CODE_OF_CONDUCT.md
  24. CONTRIBUTING.md
  25. LICENSE
  26. OWNERS
  27. PATENTS
  28. README.md
  29. 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.