[ffx] Add default config rules for client commands.

This change does a few things:
-- Makes `-t` set `target.default` in the runtime config.
-- Makes a macro that allows for config fallback of any arbitraty struct
   field that is an `Option<String>` and `Option<f64>`
   (more types will be added as needed).
-- Changes get-ssh-address command to use `target.default` rather than
   accepting a parameter.
-- Uses backup of timeout to a config value.
-- Removes use of `inner_lock` on TargetCollection to make deadlocks
less likely to occur from misuse (as there is now no way to access the
inner locking mechanisms).
-- Removes timeouts inside the daemon, allowing for target queries to
run an arbitrary amount of time if necessary (as long as the client
stays up).

Example usage of macro:

```rust
 #[derive(FfxConfigBacked, Default)]
 struct Foo {
   #[ffx_config_default(key = "timeout", default = "1.0")]
   field_one: Option<f64>,

   #[ffx_config_default("nodename")]
   field_two: Option<String>
 }
```

These will generate according functions for looking up the respective
values from the FFX config.

This is used in the two plugins, one for getting the default target, the
other for setting a timeout for getting the ssh address of a target.

Bug: 59622

Change-Id: I5a98842512990a33761e1abc6c9838d64ea46550
Reviewed-on: https://fuchsia-review.googlesource.com/c/fuchsia/+/436334
Reviewed-by: Matthew Boetger <boetger@google.com>
Commit-Queue: Andrew Davies <awdavies@google.com>
API-Review: James Tucker <raggi@google.com>
Testability-Review: James Tucker <raggi@google.com>
18 files changed
tree: ac22efc128d5ff3781791090ba20b2303d4b7e47
  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. .gitattributes
  17. .gitignore
  18. .gn
  19. .style.yapf
  20. AUTHORS
  21. BUILD.gn
  22. CODE_OF_CONDUCT.md
  23. CONTRIBUTING.md
  24. LICENSE
  25. OWNERS
  26. PATENTS
  27. README.md
  28. 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.

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.