| // Copyright 2024 The Fuchsia Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| library fuchsia.component; |
| |
| using zx; |
| |
| /// A protocol used by a component instance to obtain information about |
| /// components in its own realm. |
| /// |
| /// This protocol only supports getting the moniker at the moment but could |
| /// expand to other privileged information such as the URL of a component. |
| /// |
| /// The component framework provides this capability to components that use |
| /// `fuchsia.component.Introspector` from framework. |
| @available(added=HEAD) |
| @discoverable(server="platform") |
| open protocol Introspector { |
| /// Obtains the moniker relative to this realm of the component |
| /// corresponding to the provided token. Runners may obtain the token via |
| /// `fuchsia.component.runner/ComponentStartInfo.component_instance`. |
| /// |
| /// Returns `Error.INSTANCE_NOT_FOUND` if the token is invalid, or |
| /// does not correspond to a component under this realm. |
| flexible GetMoniker(resource struct { |
| component_instance zx.Handle:EVENT; |
| }) -> (struct { |
| moniker string:MAX_MONIKER_LENGTH; |
| }) error Error; |
| }; |