| // Copyright 2019 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.sys2; |
| |
| using fuchsia.component; |
| using fuchsia.data; |
| using fuchsia.io2; |
| |
| /// Declares a capability used by a component, which was offered to the |
| /// component's environment. |
| flexible union UseDecl { |
| 1: UseServiceDecl service; |
| 2: UseProtocolDecl protocol; |
| 3: UseDirectoryDecl directory; |
| 4: UseStorageDecl storage; |
| 5: UseRunnerDecl runner; |
| 6: UseEventDecl event; |
| }; |
| |
| /// Declares a service used by a component, which was offered to the component's |
| /// environment. |
| /// |
| /// To learn more about services, see: |
| /// https://fuchsia.dev/fuchsia-src/glossary#service |
| table UseServiceDecl { |
| /// The provider of the service relative to the component itself. Must |
| /// be `realm` or `framework`. |
| 1: Ref source; |
| |
| /// Path identifying the service, by which it was presented to this |
| /// component. |
| /// |
| /// Must be an absolute path starting with /. |
| 2: string:fuchsia.component.MAX_PATH_LENGTH source_path; |
| |
| /// The path where the capability should be installed in the component's |
| /// namespace. |
| /// |
| /// Must be an absolute path starting with /. |
| 3: string:fuchsia.component.MAX_PATH_LENGTH target_path; |
| }; |
| |
| /// Declares a legacy service used by a component, which was offered to the |
| /// component's environment. |
| /// |
| /// A legacy service is a service with a single instance, provided by a single |
| /// FIDL protocol. |
| table UseProtocolDecl { |
| /// The provider of the legacy service relative to the component itself. |
| /// Must be `realm` or `framework`. |
| 1: Ref source; |
| |
| /// Path identifying the legacy service, by which it was presented to this |
| /// component. |
| 2: string:fuchsia.component.MAX_PATH_LENGTH source_path; |
| |
| /// The path where the capability should be installed in the component's |
| /// namespace. |
| /// |
| /// Must be an absolute path starting with /. |
| 3: string:fuchsia.component.MAX_PATH_LENGTH target_path; |
| }; |
| |
| /// Declares a directory used by a component, which was offered to the |
| /// component's environment. |
| table UseDirectoryDecl { |
| /// The provider of the directory relative to the component itself. Must |
| /// be `realm` or `framework`. |
| 1: Ref source; |
| |
| /// Path identifying the directory, by which it was presented to this |
| /// component. |
| 2: string:fuchsia.component.MAX_PATH_LENGTH source_path; |
| |
| /// The path where the capability should be installed in the component's |
| /// namespace. |
| /// |
| /// Must be an absolute path starting with /. |
| 3: string:fuchsia.component.MAX_PATH_LENGTH target_path; |
| |
| /// The rights required by the component to use this directory. |
| 4: fuchsia.io2.Rights rights; |
| |
| /// The subdirectory of this directory to use instead of the root. Optional. |
| 5: string:fuchsia.component.MAX_PATH_LENGTH subdir; |
| }; |
| |
| /// Declares storage used by a component, which was offered to the component's |
| /// environment. |
| table UseStorageDecl { |
| /// Type of storage used by the component. |
| 1: StorageType type; |
| |
| /// The path where the capability should be installed in the component's |
| /// namespace. Must not be set if `type` is `META`. |
| /// |
| /// Must be an absolute path starting with /. |
| 2: string:fuchsia.component.MAX_PATH_LENGTH target_path; |
| }; |
| |
| /// Declares a runner used by a component, which was offered to the component's |
| /// environment. |
| table UseRunnerDecl { |
| /// The name of the runner, as it was presented to this component by the |
| /// realm. |
| 1: fuchsia.component.runner_name source_name; |
| }; |
| |
| /// Declares an event used by a component. |
| table UseEventDecl { |
| /// The provider of the event. Must be |realm| or |framework|. |
| 1: Ref source; |
| |
| /// Name identifying the event which was presented to this component. |
| 2: fuchsia.component.event_name source_name; |
| |
| /// The name which the component will use to refer to this event. |
| 3: fuchsia.component.event_name target_name; |
| |
| /// Filter for the event. The structure of the filter depends on the event type. May be absent |
| /// for some events. |
| 4: fuchsia.data.Dictionary filter; |
| }; |