# inspect::PublishOptions

`#include <component.h>`

Options for a published `https://fuchsia.dev/reference/cpp/class/inspect/component-inspector#classinspect_1_1_component_inspector`.

## Summary

The default constructor is acceptable for many components, and will cause a default [Inspector](https://fuchsia.dev/reference/cpp/class/inspect/inspector#classinspect_1_1_inspector) to be published via `fuchsia.inspect.InspectSink`, connected via the component's default namespace, using default `https://fuchsia.dev/reference/cpp/struct/inspect/tree-handler-settings#structinspect_1_1_tree_handler_settings`.

| ### Public attributes ||
|---|---|
| `https://fuchsia.dev/reference/cpp/struct/inspect/publish-options#structinspect_1_1_publish_options_1af23c7a2876ada79f0720b2bf74dc3d73 = std::nullopt` | `std::optional< https://fuchsia.dev/reference/cpp/other/singletonfidl/client-end#singletonfidl_1_1_client_end< fuchsia_inspect::InspectSink > >` Provide a [fidl::ClientEnd](https://fuchsia.dev/reference/cpp/other/singletonfidl/client-end#singletonfidl_1_1_client_end), useful if `fuchsia.inspect.InspectSink` is not in the root namespace or is renamed. |
| `https://fuchsia.dev/reference/cpp/struct/inspect/publish-options#structinspect_1_1_publish_options_1affd32bbafa833e6126cfd73906c01620 = {}` | `https://fuchsia.dev/reference/cpp/class/inspect/inspector#classinspect_1_1_inspector` Optionally specify an existing `https://fuchsia.dev/reference/cpp/class/inspect/inspector#classinspect_1_1_inspector`. |
| `https://fuchsia.dev/reference/cpp/struct/inspect/publish-options#structinspect_1_1_publish_options_1abc74873f2cbf8703adb2bc91fafa8df8 = {}` | `https://fuchsia.dev/reference/cpp/struct/inspect/tree-handler-settings#structinspect_1_1_tree_handler_settings` Specify how `fuchsia.inspect.Tree` should behave. |
| `https://fuchsia.dev/reference/cpp/struct/inspect/publish-options#structinspect_1_1_publish_options_1a808c7ba821723e6fc2c015a3166ac4f1 = std::nullopt` | `std::optional< std::string >` Provide a name to appear in the tree's Inspect Metadata. |

## Public attributes

### client_end

```c++
std::optional< fidl::ClientEnd< fuchsia_inspect::InspectSink > > inspect::PublishOptions::client_end = std::nullopt
```
Provide a [fidl::ClientEnd](https://fuchsia.dev/reference/cpp/other/singletonfidl/client-end#singletonfidl_1_1_client_end), useful if `fuchsia.inspect.InspectSink` is not in the root namespace or is renamed.

### inspector

```c++
Inspector inspect::PublishOptions::inspector = {}
```
Optionally specify an existing `https://fuchsia.dev/reference/cpp/class/inspect/inspector#classinspect_1_1_inspector`.

### tree_handler_settings

```c++
TreeHandlerSettings inspect::PublishOptions::tree_handler_settings = {}
```
Specify how `fuchsia.inspect.Tree` should behave.

### tree_name

```c++
std::optional< std::string > inspect::PublishOptions::tree_name = std::nullopt
```
Provide a name to appear in the tree's Inspect Metadata.

By default, it will be \`fuchsia.inspect::DEFAULT_TREE_NAME