Crate vfs

Source
Expand description

A library to create “pseudo” file systems. These file systems are backed by in process callbacks. Examples are: component configuration, debug information or statistics.

Re-exports§

pub use common::CreationMode;
pub use object_request::ObjectRequest;
pub use object_request::ObjectRequestRef;
pub use object_request::ToObjectRequest;
pub use path::Path;
pub use ::name;

Modules§

common
Common utilities used by both directory and file traits.
directory
Module holding different kinds of pseudo directories and their building blocks.
execution_scope
Values of this type represent “execution scopes” used by the library to give fine grained control of the lifetimes of the tasks associated with particular connections. When a new connection is attached to a pseudo directory tree, an execution scope is provided. This scope is then used to start any tasks related to this connection. All connections opened as a result of operations on this first connection will also use the same scope, as well as any tasks related to those connections.
file
Module holding different kinds of files and their building blocks.
node
Implementation of a (limited) node connection.
object_request
path
Type that represents a path in a file system. Objects of this type own a String that holds the “full” path and provide an iterator that goes over individual components of the path. This approach is used to allow passing the path string, from one open() method to the next, without the need to copy the path itself.
remote
A node which forwards open requests to a remote fuchsia.io server.
service
Implementations of a service endpoint.
symlink
Server support for symbolic links.
temp_clone
test_utils
Utilities used by tests in both file and directory modules.
token_registry
Implementation of TokenRegistry.
tree_builder
A helper to build a tree of directory nodes. It is useful in case when a nested tree is desired, with specific nodes to be inserted as the leafs of this tree. It is similar to the functionality provided by the vfs_macros::pseudo_directory! macro, except that the macro expects the tree structure to be defined at compile time, while this helper allows the tree structure to be dynamic.

Macros§

assert_channel_closed
assert_close
assert_event
assert_get_attr
assert_get_attr_path
assert_get_attributes
assert_get_token
assert_get_token_err
assert_get_vmo
assert_get_vmo_err
assert_link_err
assert_query
assert_read
assert_read_at
assert_read_at_err
assert_read_dirents
assert_read_dirents_err
assert_read_dirents_one_listing
assert_read_dirents_path_one_listing
assert_read_err
assert_read_fidl_err_closed
assert_rename
assert_rename_err
assert_rewind
Calls rewind on the provided proxy, checking that the result status is Status::OK.
assert_seek
assert_truncate
assert_truncate_err
assert_unlink
assert_unlink_err
assert_vmo_content
Wraps an assert_vmo_content() call, panicking with a descriptive error message for any Err return values.
assert_watch
assert_watch_err
assert_watcher_one_message_watched_events
assert_write
assert_write_at
assert_write_at_err
assert_write_err
assert_write_fidl_err_closed
attributes
Helper for building fio::NodeAttributes2givenrequestedattributes. Code will only run forrequested` attributes.
clone_as_directory_assert_err
clone_as_file_assert_err
clone_get_directory_proxy_assert_ok
clone_get_proxy_assert
clone_get_service_proxy_assert_ok
clone_get_vmo_file_proxy_assert_err
clone_get_vmo_file_proxy_assert_ok
immutable_attributes
Helper for building fio::NodeAttributes2given immutable attributes inrequestedCode will only run forrequestedattributes. Mutable attributes inrequested` are ignored.
open_as_directory_assert_err
open_as_file_assert_err
open_as_vmo_file_assert_content
Opens the specified path as a VMO file and checks its content. Also see all the assert_* macros in ../test_utils.rs.
open_get_directory_proxy_assert_ok
open_get_proxy_assert
open_get_vmo_file_proxy_assert_ok
pseudo_directory
Builds a pseudo directory using a simple DSL, potentially containing files and nested pseudo directories.

Traits§

ProtocolsExt
Extends fio::Flags and fio::OpenFlags

Functions§

serve_directory
Helper function to serve a new connection to the directory at path under root with flags. Errors will be communicated via epitaph on the returned proxy. A new ExecutionScope will be created for the request.
serve_file
Helper function to serve a new connection to the file at path under root with flags. Errors will be communicated via epitaph on the returned proxy. A new ExecutionScope will be created for the request.