Skip to main content

FileOperation

Enum FileOperation 

Source
pub enum FileOperation {
    Read {
        max_bytes: usize,
    },
    Write(Vec<u8>),
    Entries {
        max_entries: usize,
        max_name_bytes: usize,
    },
    Exists,
    Mkdir {
        recursive: bool,
    },
    Unlink,
    Rmdir,
    Stat {
        link: bool,
    },
    Rename {
        to: String,
    },
    Readlink,
}
Expand description

Filesystem operations provided by a host.

Variants§

§

Read

Read a regular file, refusing larger files before allocating them.

Fields

§max_bytes: usize

Maximum returned byte count.

§

Write(Vec<u8>)

Replace a regular file’s contents.

§

Entries

List entries, stopping before either bound is exceeded.

Fields

§max_entries: usize

Maximum number of entries.

§max_name_bytes: usize

Maximum total UTF-8 name bytes.

§

Exists

Test existence.

§

Mkdir

Create a directory.

Fields

§recursive: bool

Create missing parents too.

Remove a file.

§

Rmdir

Remove an empty directory.

§

Stat

Read metadata, optionally for a link itself.

Fields

§link: bool

Inspect the link itself.

§

Rename

Move to another normalized relative path.

Fields

§to: String

Destination relative to the same app root.

Read a link’s target.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.