blob: 7b454c48896fce4837dd808d744865fa36c5273a [file] [log] [blame]
// 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.io2;
using fuchsia.component;
/// Declares a capability used by a component, which was offered to the
/// component's environment.
xunion UseDecl {
1: UseServiceDecl service;
2: UseProtocolDecl protocol;
3: UseDirectoryDecl directory;
4: UseStorageDecl storage;
5: UseRunnerDecl runner;
};
/// 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;
};