Trait FileSystem

Source
pub trait FileSystem {
    // Provided methods
    fn host_open(
        &self,
        _filename: Vec<u8>,
        _flags: HostOpenFlags,
        _mode: HostMode,
    ) -> IOResult<u64> { ... }
    fn host_close(&self, _fd: u64) -> IOResult<()> { ... }
    fn host_pread(
        &self,
        _fd: u64,
        _count: u64,
        _offset: u64,
    ) -> IOResult<Vec<u8>> { ... }
    fn host_pwrite(
        &self,
        _fd: u64,
        _offset: u64,
        _data: Vec<u8>,
    ) -> IOResult<u64> { ... }
    fn host_fstat(&self, _fd: u64) -> IOResult<HostStat> { ... }
    fn host_unlink(&self, _filename: Vec<u8>) -> IOResult<()> { ... }
    fn host_readlink(&self, _filename: Vec<u8>) -> IOResult<Vec<u8>> { ... }
    fn host_setfs(&self, _pid: u64) -> IOResult<()> { ... }
}
Expand description

TODO: doc

Provided Methods§

Source

fn host_open( &self, _filename: Vec<u8>, _flags: HostOpenFlags, _mode: HostMode, ) -> IOResult<u64>

Open a file on the remote stub’s current filesystem.

Source

fn host_close(&self, _fd: u64) -> IOResult<()>

Close a file opened with host_open.

Source

fn host_pread(&self, _fd: u64, _count: u64, _offset: u64) -> IOResult<Vec<u8>>

Read data from an open file at the given offset.

Source

fn host_pwrite(&self, _fd: u64, _offset: u64, _data: Vec<u8>) -> IOResult<u64>

Write data to an open file at the given offset.

Source

fn host_fstat(&self, _fd: u64) -> IOResult<HostStat>

Return a HostStat describing the attributes of the given open file.

Remove a file from the remote stub’s current filesystem.

Read the contents of a symbolic link on the remote stub’s current filesystem.

Source

fn host_setfs(&self, _pid: u64) -> IOResult<()>

Set the current filesystem for subsequent host I/O requests. If the given pid is 0, select the filesystem of the remote stub. Otherwise, select the filesystem as seen by the process with the given pid.

Implementors§