| // 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.io; |
| |
| /// A node may have multiple supported representations when opening, even though |
| /// it may have a fixed underlying identity. |
| /// |
| /// Today, a file is accessed via the [`File`] protocol, and sends a |
| /// [`Representation.FileInfo`] when opened with `GET_REPRESENTATION`. However, |
| /// in the future we might introduce a more sophisticated `FileV2` protocol, or |
| /// a more efficient `SuperFastFile` backed by a specialized kernel object. New |
| /// clients can request the more advanced representations by specifying the |
| /// corresponding bits in [`NodeProtocolKinds`], whereas existing clients would |
| /// continue to talk to the node via the old representation. |
| /// |
| /// [`NodeProtocolKinds`] enables forward-compatibility through a form of protocol |
| /// negotiation. |
| /// |
| /// The elements have one-to-one correspondence with the members of |
| /// [`Representation`]. |
| type NodeProtocolKinds = flexible bits : uint64 { |
| /// The connector representation of a node. |
| /// |
| /// The connection will speak either [`Node`] or the target protocol, |
| /// depending on the flags used during opening. |
| CONNECTOR = 0x1; |
| |
| /// The directory representation of a node. |
| /// |
| /// The connection will speak the [`Directory`] protocol. |
| DIRECTORY = 0x2; |
| |
| /// The file representation of a node. |
| /// |
| /// The connection will speak the [`File`] protocol. |
| FILE = 0x4; |
| |
| /// The symlink representation of a node. |
| /// |
| /// The connection will speak the [`Symlink`] protocol. |
| @available(added=HEAD) |
| SYMLINK = 0x8; |
| }; |