Struct wasmtime_wasi::Wasi
source · [−]pub struct Wasi {Show 45 fields
pub args_get: Func,
pub args_sizes_get: Func,
pub environ_get: Func,
pub environ_sizes_get: Func,
pub clock_res_get: Func,
pub clock_time_get: Func,
pub fd_advise: Func,
pub fd_allocate: Func,
pub fd_close: Func,
pub fd_datasync: Func,
pub fd_fdstat_get: Func,
pub fd_fdstat_set_flags: Func,
pub fd_fdstat_set_rights: Func,
pub fd_filestat_get: Func,
pub fd_filestat_set_size: Func,
pub fd_filestat_set_times: Func,
pub fd_pread: Func,
pub fd_prestat_get: Func,
pub fd_prestat_dir_name: Func,
pub fd_pwrite: Func,
pub fd_read: Func,
pub fd_readdir: Func,
pub fd_renumber: Func,
pub fd_seek: Func,
pub fd_sync: Func,
pub fd_tell: Func,
pub fd_write: Func,
pub path_create_directory: Func,
pub path_filestat_get: Func,
pub path_filestat_set_times: Func,
pub path_link: Func,
pub path_open: Func,
pub path_readlink: Func,
pub path_remove_directory: Func,
pub path_rename: Func,
pub path_symlink: Func,
pub path_unlink_file: Func,
pub poll_oneoff: Func,
pub proc_exit: Func,
pub proc_raise: Func,
pub sched_yield: Func,
pub random_get: Func,
pub sock_recv: Func,
pub sock_send: Func,
pub sock_shutdown: Func,
}
Expand description
An instantiated instance of the wasi exports.
This represents a wasi module which can be used to instantiate other wasm
modules. This structure exports all that various fields of the wasi instance
as fields which can be used to implement your own instantiation logic, if
necessary. Additionally Wasi::get_export
can be used to do name-based
resolution.
Fields
args_get: Func
args_sizes_get: Func
environ_get: Func
environ_sizes_get: Func
clock_res_get: Func
clock_time_get: Func
fd_advise: Func
fd_allocate: Func
fd_close: Func
fd_datasync: Func
fd_fdstat_get: Func
fd_fdstat_set_flags: Func
fd_fdstat_set_rights: Func
fd_filestat_get: Func
fd_filestat_set_size: Func
fd_filestat_set_times: Func
fd_pread: Func
fd_prestat_get: Func
fd_prestat_dir_name: Func
fd_pwrite: Func
fd_read: Func
fd_readdir: Func
fd_renumber: Func
fd_seek: Func
fd_sync: Func
fd_tell: Func
fd_write: Func
path_create_directory: Func
path_filestat_get: Func
path_filestat_set_times: Func
path_link: Func
path_open: Func
path_readlink: Func
path_remove_directory: Func
path_rename: Func
path_symlink: Func
path_unlink_file: Func
poll_oneoff: Func
proc_exit: Func
proc_raise: Func
sched_yield: Func
random_get: Func
sock_recv: Func
sock_send: Func
sock_shutdown: Func
Implementations
sourceimpl Wasi
impl Wasi
sourcepub fn new(store: &Store, cx: WasiCtx) -> Self
pub fn new(store: &Store, cx: WasiCtx) -> Self
Creates a new Wasi
instance.
External values are allocated into the store
provided and
configuration of the wasi instance itself should be all
contained in the cx
parameter.
sourcepub fn get_export(&self, name: &str) -> Option<&Func>
pub fn get_export(&self, name: &str) -> Option<&Func>
Looks up a field called name
in this structure, returning it
if found.
This is often useful when instantiating a wasmtime
instance
where name resolution often happens with strings.
sourcepub fn add_to_linker(&self, linker: &mut Linker) -> Result<()>
pub fn add_to_linker(&self, linker: &mut Linker) -> Result<()>
Adds all instance items to the specified Linker
.
Auto Trait Implementations
impl !RefUnwindSafe for Wasi
impl !Send for Wasi
impl !Sync for Wasi
impl Unpin for Wasi
impl !UnwindSafe for Wasi
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more