[−][src]Struct wasihost::wasi_snapshot_preview1::WasiHost
Host functions for WASI.
Methods
impl<S: StringRepresentation> WasiHost<S>
[src]
pub fn new(
arguments: impl IntoIterator<Item = impl Into<S>>,
environment: impl IntoIterator<Item = impl Into<S>>,
fd_initialzer: impl WasiFdInitializer<S>
) -> Arc<Self>
[src]
arguments: impl IntoIterator<Item = impl Into<S>>,
environment: impl IntoIterator<Item = impl Into<S>>,
fd_initialzer: impl WasiFdInitializer<S>
) -> Arc<Self>
Creates a new WASI host.
pub fn run_file(
self: Arc<Self>,
wasm_file: impl AsRef<Path>
) -> Result<exitcode, Box<dyn Error>>
[src]
self: Arc<Self>,
wasm_file: impl AsRef<Path>
) -> Result<exitcode, Box<dyn Error>>
Runs a WASM file on this WASI host.
pub fn run_binary(
self: Arc<Self>,
wasm_binary: &[u8]
) -> Result<exitcode, Box<dyn Error>>
[src]
self: Arc<Self>,
wasm_binary: &[u8]
) -> Result<exitcode, Box<dyn Error>>
Runs a WASM binary from memory on this WASI host.
Trait Implementations
impl<S: Debug + StringRepresentation> Debug for WasiHost<S>
[src]
impl<S: StringRepresentation> WasiImports for WasiHost<S>
[src]
type StringRepresentation = S
String representation in the high-level APIs.
fn args_get(&self) -> WasiResult<&[S]>
[src]
fn environ_get(&self) -> WasiResult<&[S]>
[src]
fn clock_res_get(&self, id: Clockid) -> WasiResult<Timestamp>
[src]
fn clock_time_get(
&self,
id: Clockid,
precision: Timestamp
) -> WasiResult<Timestamp>
[src]
&self,
id: Clockid,
precision: Timestamp
) -> WasiResult<Timestamp>
fn fd_advise(
&self,
fd: Fd,
offset: Filesize,
len: Filesize,
advice: Advice
) -> WasiResult<()>
[src]
&self,
fd: Fd,
offset: Filesize,
len: Filesize,
advice: Advice
) -> WasiResult<()>
fn fd_allocate(&self, fd: Fd, offset: Filesize, len: Filesize) -> WasiResult<()>
[src]
fn fd_close(&self, fd: Fd) -> WasiResult<()>
[src]
fn fd_datasync(&self, fd: Fd) -> WasiResult<()>
[src]
fn fd_fdstat_get(&self, fd: Fd) -> WasiResult<Fdstat>
[src]
fn fd_fdstat_set_flags(&self, fd: Fd, flags: Fdflags) -> WasiResult<()>
[src]
fn fd_fdstat_set_rights(
&self,
fd: Fd,
fs_rights_base: Rights,
fs_rights_inheriting: Rights
) -> WasiResult<()>
[src]
&self,
fd: Fd,
fs_rights_base: Rights,
fs_rights_inheriting: Rights
) -> WasiResult<()>
fn fd_filestat_get(&self, fd: Fd) -> WasiResult<Filestat>
[src]
fn fd_filestat_set_size(&self, fd: Fd, size: Filesize) -> WasiResult<()>
[src]
fn fd_filestat_set_times(
&self,
fd: Fd,
atim: Timestamp,
mtim: Timestamp,
fst_flags: Fstflags
) -> WasiResult<()>
[src]
&self,
fd: Fd,
atim: Timestamp,
mtim: Timestamp,
fst_flags: Fstflags
) -> WasiResult<()>
fn fd_pread(
&self,
fd: Fd,
iovs: &mut [IoSliceMut],
offset: Filesize
) -> WasiResult<Size>
[src]
&self,
fd: Fd,
iovs: &mut [IoSliceMut],
offset: Filesize
) -> WasiResult<Size>
fn fd_prestat_get(&self, fd: Fd) -> WasiResult<Prestat>
[src]
fn fd_prestat_dir_name(&self, fd: Fd) -> WasiResult<S>
[src]
fn fd_pwrite(
&self,
fd: Fd,
bufs: &[IoSlice],
offset: Filesize
) -> WasiResult<Size>
[src]
&self,
fd: Fd,
bufs: &[IoSlice],
offset: Filesize
) -> WasiResult<Size>
fn fd_read(&self, fd: Fd, iovs: &mut [IoSliceMut]) -> WasiResult<Size>
[src]
fn fd_readdir(
&self,
fd: Fd,
cookie: Dircookie
) -> WasiResult<Option<(Dirent, S)>>
[src]
&self,
fd: Fd,
cookie: Dircookie
) -> WasiResult<Option<(Dirent, S)>>
fn fd_renumber(&self, fd: Fd, to: Fd) -> WasiResult<()>
[src]
fn fd_seek(
&self,
fd: Fd,
offset: Filedelta,
whence: Whence
) -> WasiResult<Filesize>
[src]
&self,
fd: Fd,
offset: Filedelta,
whence: Whence
) -> WasiResult<Filesize>
fn fd_sync(&self, fd: Fd) -> WasiResult<()>
[src]
fn fd_tell(&self, fd: Fd) -> WasiResult<Filesize>
[src]
fn fd_write(&self, fd: Fd, bufs: &[IoSlice]) -> WasiResult<Size>
[src]
fn path_create_directory(
&self,
fd: Fd,
path: &<S as Deref>::Target
) -> WasiResult<()>
[src]
&self,
fd: Fd,
path: &<S as Deref>::Target
) -> WasiResult<()>
fn path_filestat_get(
&self,
fd: Fd,
flags: Lookupflags,
path: &<S as Deref>::Target
) -> WasiResult<Filestat>
[src]
&self,
fd: Fd,
flags: Lookupflags,
path: &<S as Deref>::Target
) -> WasiResult<Filestat>
fn path_filestat_set_times(
&self,
fd: Fd,
flags: Lookupflags,
path: &<S as Deref>::Target,
atim: Timestamp,
mtim: Timestamp,
fst_flags: Fstflags
) -> WasiResult<()>
[src]
&self,
fd: Fd,
flags: Lookupflags,
path: &<S as Deref>::Target,
atim: Timestamp,
mtim: Timestamp,
fst_flags: Fstflags
) -> WasiResult<()>
fn path_open(
&self,
fd: Fd,
dirflags: Lookupflags,
path: &<S as Deref>::Target,
oflags: Oflags,
fs_rights_base: Rights,
fs_rights_inheriting: Rights,
fdflags: Fdflags
) -> WasiResult<Fd>
[src]
&self,
fd: Fd,
dirflags: Lookupflags,
path: &<S as Deref>::Target,
oflags: Oflags,
fs_rights_base: Rights,
fs_rights_inheriting: Rights,
fdflags: Fdflags
) -> WasiResult<Fd>
fn path_link(
&self,
old_fd: Fd,
old_flags: Lookupflags,
old_path: &<S as Deref>::Target,
new_fd: Fd,
new_path: &<S as Deref>::Target
) -> WasiResult<()>
[src]
&self,
old_fd: Fd,
old_flags: Lookupflags,
old_path: &<S as Deref>::Target,
new_fd: Fd,
new_path: &<S as Deref>::Target
) -> WasiResult<()>
fn path_readlink(&self, fd: Fd, path: &<S as Deref>::Target) -> WasiResult<S>
[src]
fn path_remove_directory(
&self,
fd: Fd,
path: &<S as Deref>::Target
) -> WasiResult<()>
[src]
&self,
fd: Fd,
path: &<S as Deref>::Target
) -> WasiResult<()>
fn path_rename(
&self,
fd: Fd,
old_path: &<S as Deref>::Target,
new_fd: Fd,
new_path: &<S as Deref>::Target
) -> WasiResult<()>
[src]
&self,
fd: Fd,
old_path: &<S as Deref>::Target,
new_fd: Fd,
new_path: &<S as Deref>::Target
) -> WasiResult<()>
fn path_symlink(
&self,
old_path: &<S as Deref>::Target,
fd: Fd,
new_path: &<S as Deref>::Target
) -> WasiResult<()>
[src]
&self,
old_path: &<S as Deref>::Target,
fd: Fd,
new_path: &<S as Deref>::Target
) -> WasiResult<()>
fn path_unlink_file(
&self,
fd: Fd,
path: &<S as Deref>::Target
) -> WasiResult<()>
[src]
&self,
fd: Fd,
path: &<S as Deref>::Target
) -> WasiResult<()>
fn poll_oneoff(&self, _subscriptions: &[Subscription]) -> WasiResult<Vec<Event>>
[src]
fn proc_exit(&self, c: Exitcode) -> Result<Infallible, Exitcode>
[src]
fn proc_raise(&self, _: Signal) -> WasiResult<()>
[src]
fn random_get(&self, buf: &mut [u8]) -> WasiResult<()>
[src]
fn sched_yield(&self) -> WasiResult<()>
[src]
fn sock_recv(
&self,
fd: Fd,
ri_data: &mut [IoSliceMut],
ri_flags: Riflags
) -> WasiResult<(Size, Roflags)>
[src]
&self,
fd: Fd,
ri_data: &mut [IoSliceMut],
ri_flags: Riflags
) -> WasiResult<(Size, Roflags)>
fn sock_send(
&self,
fd: Fd,
si_data: &[IoSlice],
si_flags: Siflags
) -> WasiResult<Size>
[src]
&self,
fd: Fd,
si_data: &[IoSlice],
si_flags: Siflags
) -> WasiResult<Size>
fn sock_shutdown(&self, fd: Fd, how: Sdflags) -> WasiResult<()>
[src]
Auto Trait Implementations
impl<S> !RefUnwindSafe for WasiHost<S>
impl<S> Send for WasiHost<S>
impl<S> Sync for WasiHost<S>
impl<S> Unpin for WasiHost<S> where
S: Unpin,
S: Unpin,
impl<S> !UnwindSafe for WasiHost<S>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
[src]
type Output = T
Should always be Self
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
[src]
V: MultiLane<T>,
impl<T> WasiImportsExt for T where
T: WasiImports,
[src]
T: WasiImports,