logo
pub struct WasiFs {
    pub preopen_fds: Vec<u32>,
    pub name_map: HashMap<String, Inode>,
    pub inodes: Arena<InodeVal>,
    pub fd_map: HashMap<u32, Fd>,
    pub next_fd: Cell<u32>,
    pub orphan_fds: HashMap<Inode, InodeVal>,
    pub fs_backing: Box<dyn FileSystem>,
    /* private fields */
}
Expand description

Warning, modifying these fields directly may cause invariants to break and should be considered unsafe. These fields may be made private in a future release

Fields

preopen_fds: Vec<u32>name_map: HashMap<String, Inode>inodes: Arena<InodeVal>fd_map: HashMap<u32, Fd>next_fd: Cell<u32>orphan_fds: HashMap<Inode, InodeVal>

for fds still open after the file has been deleted

fs_backing: Box<dyn FileSystem>

Implementations

Get the VirtualFile object at stdout

Get the VirtualFile object at stdout mutably

Get the VirtualFile object at stderr

Get the VirtualFile object at stderr mutably

Get the VirtualFile object at stdin

Get the VirtualFile object at stdin mutably

This function is like create dir all, but it also opens it. Function is unsafe because it may break invariants and hasn’t been tested. This is an experimental function and may be removed

Safety
  • Virtual directories created with this function must not conflict with the standard operation of the WASI filesystem. This is vague and unlikely in pratice. Join the discussion for what the newer, safer WASI FS APIs should look like.

Opens a user-supplied file in the directory specified with the name and flags given

Change the backing of a given file descriptor Returns the old backing TODO: add examples

gets either a normal inode or an orphaned inode

Low level function to remove an inode, that is it deletes the WASI FS’s knowledge of a file.

This function returns the inode if it existed and was removed.

Safety
  • The caller must ensure that all references to the specified inode have been removed from the filesystem.

Trait Implementations

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

The archived version of the pointer metadata for this type.

Converts some archived metadata to the pointer metadata for itself.

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Deserializes using the given deserializer

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The alignment of pointer.

The type for initializers.

Initializes a with the given initializer. Read more

Dereferences the given pointer. Read more

Mutably dereferences the given pointer. Read more

Drops the object pointed to by the given pointer. Read more

The type for metadata in pointers and references to Self.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more