[][src]Enum wasmer_wasi_fl::state::Kind

pub enum Kind {
    File {
        handle: Option<Box<dyn WasiFile>>,
        path: PathBuf,
        fd: Option<u32>,
    },
    Dir {
        parent: Option<Inode>,
        path: PathBuf,
        entries: HashMap<String, Inode>,
    },
    Root {
        entries: HashMap<String, Inode>,
    },
    Symlink {
        base_po_dir: __wasi_fd_t,
        path_to_symlink: PathBuf,
        relative_path: PathBuf,
    },
    Buffer {
        buffer: Vec<u8>,
    },
}

The core of the filesystem abstraction. Includes directories, files, and symlinks.

Variants

File

Fields of File

handle: Option<Box<dyn WasiFile>>

the open file, if it's open

path: PathBuf

The path on the host system where the file is located This is deprecated and will be removed soon

fd: Option<u32>

Marks the file as a special file that only one fd can exist for This is useful when dealing with host-provided special files that should be looked up by path TOOD: clarify here?

Dir

Fields of Dir

parent: Option<Inode>

Parent directory

path: PathBuf

The path on the host system where the directory is located

entries: HashMap<String, Inode>

The entries of a directory are lazily filled.

Root

The same as Dir but without the irrelevant bits The root is immutable after creation; generally the Kind::Root branch of whatever code you're writing will be a simpler version of your Kind::Dir logic

Fields of Root

entries: HashMap<String, Inode>

The first two fields are data about the symlink the last field is the data inside the symlink

base_po_dir should never be the root because:

  • Right now symlinks are not allowed in the immutable root
  • There is always a closer pre-opened dir to the symlink file (by definition of the root being a collection of preopened dirs)

Fields of Symlink

base_po_dir: __wasi_fd_t

The preopened dir that this symlink file is relative to (via path_to_symlink)

path_to_symlink: PathBuf

The path to the symlink from the base_po_dir

relative_path: PathBuf

the value of the symlink as a relative path

Buffer

Fields of Buffer

buffer: Vec<u8>

Trait Implementations

impl Debug for Kind[src]

impl<'de> Deserialize<'de> for Kind[src]

impl Serialize for Kind[src]

Auto Trait Implementations

impl !RefUnwindSafe for Kind

impl Send for Kind

impl !Sync for Kind

impl Unpin for Kind

impl !UnwindSafe for Kind

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> Serialize for T where
    T: Serialize + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.