blob: c7ec655db5e80c879f588316d6e8a4e0962c6bdd [file] [log] [blame]
// Copyright 2022 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 fuchsia.component.sandbox;
@available(added=20)
type NamespaceInputEntry = resource struct {
path string:MAX_PATH_LENGTH;
dictionary client_end:fuchsia.component.sandbox.Dictionary;
};
/// Error returned from methods in [`Namespace`].
@available(added=20)
type NamespaceError = flexible enum {
/// The parent of a parent shares a prefix with another namespace entry
SHADOW = 1;
/// Two entries have the same namespace path.
DUPLICATE = 2;
/// Failed to convert a namespace dictionary to a directory.
CONVERSION = 3;
/// A namespace entry was invalid.
BAD_ENTRY = 4;
/// There was an error reading from one of the dictionaries.
DICTIONARY_READ = 5;
};
/// Protocol for performing namespace operations.
@available(added=20)
@discoverable
open protocol Namespace {
flexible Create(resource struct {
entries vector<NamespaceInputEntry>:MAX;
}) -> (resource struct {
entries vector<NamespaceEntry>:MAX;
}) error NamespaceError;
};