blob: ebfcaeea086867fd3cc3b95717dbab5eab820477 [file] [log] [blame]
// Copyright 2021 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 test.fidl.pkg;
using fuchsia.io;
/// Packages can only be backed by package-directory. To test a new implementation, add a field
/// here so the tests can request it.
type Backing = strict enum {
PKGDIR = 0;
};
/// Error codes for `ConnectPackage`.
type ConnectError = strict enum {
/// The harness encountered an otherwise unspecified error while handling the request.
INTERNAL = 1;
/// The harness does not support the provided backing.
UNSUPPORTED_BACKING = 2;
};
/// This protocol can be used to connect to a package.
@discoverable
protocol Harness {
/// Connects to a package with the requested `backing`. A package is a directory tree with
/// additional constraints: e.g. there is a meta/ subdirectory, meta/contents and meta/package
/// files, the entries in meta/contents appear in the directory tree itself, and the files are
/// not writable. For more context, see the package
/// [documentation](https://fuchsia.dev/fuchsia-src/concepts/packages/package).
///
/// + request `backing` is the package directory implementation.
/// + request `dir` is the server end to serve the package over.
/// * error a `ConnectError` value indicating failure reason.
ConnectPackage(resource struct {
backing Backing;
dir server_end:fuchsia.io.Directory;
}) -> (struct {}) error ConnectError;
};