| // 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=HEAD) |
| type NamespaceInputEntry = resource struct { |
| path string:MAX_PATH_LENGTH; |
| dictionary client_end:fuchsia.component.sandbox.Dictionary; |
| }; |
| |
| /// Error returned from methods in [`Namespace`]. |
| @available(added=HEAD) |
| 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=HEAD) |
| @discoverable |
| open protocol Namespace { |
| flexible Create(resource struct { |
| entries vector<NamespaceInputEntry>:MAX; |
| }) -> (resource struct { |
| entries vector<NamespaceEntry>:MAX; |
| }) error NamespaceError; |
| }; |