Struct wasmtime_wasi::WasiCtx
source · [−]pub struct WasiCtx { /* private fields */ }
Implementations
sourceimpl WasiCtx
impl WasiCtx
sourcepub fn new<S>(
args: impl IntoIterator<Item = S>
) -> Result<WasiCtx, WasiCtxBuilderError> where
S: AsRef<[u8]>,
pub fn new<S>(
args: impl IntoIterator<Item = S>
) -> Result<WasiCtx, WasiCtxBuilderError> where
S: AsRef<[u8]>,
Make a new WasiCtx
with some default settings.
-
File descriptors 0, 1, and 2 inherit stdin, stdout, and stderr from the host process.
-
Environment variables are inherited from the host process.
To override these behaviors, use WasiCtxBuilder
.
Trait Implementations
sourceimpl GuestErrorConversion for WasiCtx
impl GuestErrorConversion for WasiCtx
pub fn into_errno(&self, e: GuestError) -> Errno
sourceimpl GuestErrorConversion for WasiCtx
impl GuestErrorConversion for WasiCtx
pub fn into_errno(&self, e: GuestError) -> Errno
sourceimpl UserErrorConversion for WasiCtx
impl UserErrorConversion for WasiCtx
sourceimpl UserErrorConversion for WasiCtx
impl UserErrorConversion for WasiCtx
sourceimpl<'a> WasiSnapshotPreview1 for WasiCtx
impl<'a> WasiSnapshotPreview1 for WasiCtx
pub fn args_get(
&self,
argv: &GuestPtr<'b, GuestPtr<'b, u8>>,
argv_buf: &GuestPtr<'b, u8>
) -> Result<(), Error>
pub fn args_sizes_get(&self) -> Result<(u32, u32), Error>
pub fn environ_get(
&self,
environ: &GuestPtr<'b, GuestPtr<'b, u8>>,
environ_buf: &GuestPtr<'b, u8>
) -> Result<(), Error>
pub fn environ_sizes_get(&self) -> Result<(u32, u32), Error>
pub fn clock_res_get(&self, id: Clockid) -> Result<u64, Error>
pub fn clock_time_get(&self, id: Clockid, _precision: u64) -> Result<u64, Error>
pub fn fd_advise(
&self,
fd: Fd,
offset: u64,
len: u64,
advice: Advice
) -> Result<(), Error>
pub fn fd_allocate(&self, fd: Fd, offset: u64, len: u64) -> Result<(), Error>
pub fn fd_close(&self, fd: Fd) -> Result<(), Error>
pub fn fd_datasync(&self, fd: Fd) -> Result<(), Error>
pub fn fd_fdstat_get(&self, fd: Fd) -> Result<Fdstat, Error>
pub fn fd_fdstat_set_flags(&self, fd: Fd, flags: Fdflags) -> Result<(), Error>
pub fn fd_fdstat_set_rights(
&self,
fd: Fd,
fs_rights_base: Rights,
fs_rights_inheriting: Rights
) -> Result<(), Error>
pub fn fd_filestat_get(&self, fd: Fd) -> Result<Filestat, Error>
pub fn fd_filestat_set_size(&self, fd: Fd, size: u64) -> Result<(), Error>
pub fn fd_filestat_set_times(
&self,
fd: Fd,
atim: u64,
mtim: u64,
fst_flags: Fstflags
) -> Result<(), Error>
pub fn fd_pread(
&self,
fd: Fd,
iovs: &GuestPtr<'_, [Iovec<'_>]>,
offset: u64
) -> Result<u32, Error>
pub fn fd_prestat_get(&self, fd: Fd) -> Result<Prestat, Error>
pub fn fd_prestat_dir_name(
&self,
fd: Fd,
path: &GuestPtr<'_, u8>,
path_len: u32
) -> Result<(), Error>
pub fn fd_pwrite(
&self,
fd: Fd,
ciovs: &GuestPtr<'_, [Ciovec<'_>]>,
offset: u64
) -> Result<u32, Error>
pub fn fd_read(
&self,
fd: Fd,
iovs: &GuestPtr<'_, [Iovec<'_>]>
) -> Result<u32, Error>
pub fn fd_readdir(
&self,
fd: Fd,
buf: &GuestPtr<'_, u8>,
buf_len: u32,
cookie: u64
) -> Result<u32, Error>
pub fn fd_renumber(&self, from: Fd, to: Fd) -> Result<(), Error>
pub fn fd_seek(&self, fd: Fd, offset: i64, whence: Whence) -> Result<u64, Error>
pub fn fd_sync(&self, fd: Fd) -> Result<(), Error>
pub fn fd_tell(&self, fd: Fd) -> Result<u64, Error>
pub fn fd_write(
&self,
fd: Fd,
ciovs: &GuestPtr<'_, [Ciovec<'_>]>
) -> Result<u32, Error>
pub fn path_create_directory(
&self,
dirfd: Fd,
path: &GuestPtr<'_, str>
) -> Result<(), Error>
pub fn path_filestat_get(
&self,
dirfd: Fd,
flags: Lookupflags,
path: &GuestPtr<'_, str>
) -> Result<Filestat, Error>
pub fn path_filestat_set_times(
&self,
dirfd: Fd,
flags: Lookupflags,
path: &GuestPtr<'_, str>,
atim: u64,
mtim: u64,
fst_flags: Fstflags
) -> Result<(), Error>
pub fn path_link(
&self,
old_fd: Fd,
old_flags: Lookupflags,
old_path: &GuestPtr<'_, str>,
new_fd: Fd,
new_path: &GuestPtr<'_, str>
) -> Result<(), Error>
pub fn path_open(
&self,
dirfd: Fd,
dirflags: Lookupflags,
path: &GuestPtr<'_, str>,
oflags: Oflags,
fs_rights_base: Rights,
fs_rights_inheriting: Rights,
fdflags: Fdflags
) -> Result<Fd, Error>
pub fn path_readlink(
&self,
dirfd: Fd,
path: &GuestPtr<'_, str>,
buf: &GuestPtr<'_, u8>,
buf_len: u32
) -> Result<u32, Error>
pub fn path_remove_directory(
&self,
dirfd: Fd,
path: &GuestPtr<'_, str>
) -> Result<(), Error>
pub fn path_rename(
&self,
old_fd: Fd,
old_path: &GuestPtr<'_, str>,
new_fd: Fd,
new_path: &GuestPtr<'_, str>
) -> Result<(), Error>
pub fn path_symlink(
&self,
old_path: &GuestPtr<'_, str>,
dirfd: Fd,
new_path: &GuestPtr<'_, str>
) -> Result<(), Error>
pub fn path_unlink_file(
&self,
dirfd: Fd,
path: &GuestPtr<'_, str>
) -> Result<(), Error>
pub fn poll_oneoff(
&self,
in_: &GuestPtr<'_, Subscription>,
out: &GuestPtr<'_, Event>,
nsubscriptions: u32
) -> Result<u32, Error>
pub fn proc_exit(&self, _rval: u32) -> Result<(), ()>
pub fn proc_raise(&self, _sig: Signal) -> Result<(), Error>
pub fn sched_yield(&self) -> Result<(), Error>
pub fn random_get(
&self,
buf: &GuestPtr<'_, u8>,
buf_len: u32
) -> Result<(), Error>
pub fn sock_recv(
&self,
_fd: Fd,
_ri_data: &GuestPtr<'_, [Iovec<'_>]>,
_ri_flags: Riflags
) -> Result<(u32, Roflags), Error>
pub fn sock_send(
&self,
_fd: Fd,
_si_data: &GuestPtr<'_, [Ciovec<'_>]>,
_si_flags: u16
) -> Result<u32, Error>
pub fn sock_shutdown(&self, _fd: Fd, _how: Sdflags) -> Result<(), Error>
sourceimpl WasiUnstable for WasiCtx
impl WasiUnstable for WasiCtx
pub fn args_get(
&self,
argv: &GuestPtr<'a, GuestPtr<'a, u8>>,
argv_buf: &GuestPtr<'a, u8>
) -> Result<(), Error>
pub fn args_sizes_get(&self) -> Result<(u32, u32), Error>
pub fn environ_get(
&self,
environ: &GuestPtr<'a, GuestPtr<'a, u8>>,
environ_buf: &GuestPtr<'a, u8>
) -> Result<(), Error>
pub fn environ_sizes_get(&self) -> Result<(u32, u32), Error>
pub fn clock_res_get(&self, id: Clockid) -> Result<u64, Error>
pub fn clock_time_get(&self, id: Clockid, precision: u64) -> Result<u64, Error>
pub fn fd_advise(
&self,
fd: Fd,
offset: u64,
len: u64,
advice: Advice
) -> Result<(), Error>
pub fn fd_allocate(&self, fd: Fd, offset: u64, len: u64) -> Result<(), Error>
pub fn fd_close(&self, fd: Fd) -> Result<(), Error>
pub fn fd_datasync(&self, fd: Fd) -> Result<(), Error>
pub fn fd_fdstat_get(&self, fd: Fd) -> Result<Fdstat, Error>
pub fn fd_fdstat_set_flags(&self, fd: Fd, flags: Fdflags) -> Result<(), Error>
pub fn fd_fdstat_set_rights(
&self,
fd: Fd,
fs_rights_base: Rights,
fs_rights_inheriting: Rights
) -> Result<(), Error>
pub fn fd_filestat_get(&self, fd: Fd) -> Result<Filestat, Error>
pub fn fd_filestat_set_size(&self, fd: Fd, size: u64) -> Result<(), Error>
pub fn fd_filestat_set_times(
&self,
fd: Fd,
atim: u64,
mtim: u64,
fst_flags: Fstflags
) -> Result<(), Error>
pub fn fd_pread(
&self,
fd: Fd,
iovs: &GuestPtr<'a, [Iovec<'a>]>,
offset: u64
) -> Result<u32, Error>
pub fn fd_prestat_get(&self, fd: Fd) -> Result<Prestat, Error>
pub fn fd_prestat_dir_name(
&self,
fd: Fd,
path: &GuestPtr<'a, u8>,
path_len: u32
) -> Result<(), Error>
pub fn fd_pwrite(
&self,
fd: Fd,
iovs: &GuestPtr<'a, [Ciovec<'a>]>,
offset: u64
) -> Result<u32, Error>
pub fn fd_read(
&self,
fd: Fd,
iovs: &GuestPtr<'a, [Iovec<'a>]>
) -> Result<u32, Error>
pub fn fd_readdir(
&self,
fd: Fd,
buf: &GuestPtr<'a, u8>,
buf_len: u32,
cookie: u64
) -> Result<u32, Error>
pub fn fd_renumber(&self, from: Fd, to: Fd) -> Result<(), Error>
pub fn fd_seek(&self, fd: Fd, offset: i64, whence: Whence) -> Result<u64, Error>
pub fn fd_sync(&self, fd: Fd) -> Result<(), Error>
pub fn fd_tell(&self, fd: Fd) -> Result<u64, Error>
pub fn fd_write(
&self,
fd: Fd,
iovs: &GuestPtr<'a, [Ciovec<'a>]>
) -> Result<u32, Error>
pub fn path_create_directory(
&self,
fd: Fd,
path: &GuestPtr<'a, str>
) -> Result<(), Error>
pub fn path_filestat_get(
&self,
fd: Fd,
flags: Lookupflags,
path: &GuestPtr<'a, str>
) -> Result<Filestat, Error>
pub fn path_filestat_set_times(
&self,
fd: Fd,
flags: Lookupflags,
path: &GuestPtr<'a, str>,
atim: u64,
mtim: u64,
fst_flags: Fstflags
) -> Result<(), Error>
pub fn path_link(
&self,
old_fd: Fd,
old_flags: Lookupflags,
old_path: &GuestPtr<'a, str>,
new_fd: Fd,
new_path: &GuestPtr<'a, str>
) -> Result<(), Error>
pub fn path_open(
&self,
fd: Fd,
dirflags: Lookupflags,
path: &GuestPtr<'a, str>,
oflags: Oflags,
fs_rights_base: Rights,
fs_rights_inheriting: Rights,
fdflags: Fdflags
) -> Result<Fd, Error>
pub fn path_readlink(
&self,
fd: Fd,
path: &GuestPtr<'a, str>,
buf: &GuestPtr<'a, u8>,
buf_len: u32
) -> Result<u32, Error>
pub fn path_remove_directory(
&self,
fd: Fd,
path: &GuestPtr<'a, str>
) -> Result<(), Error>
pub fn path_rename(
&self,
fd: Fd,
old_path: &GuestPtr<'a, str>,
new_fd: Fd,
new_path: &GuestPtr<'a, str>
) -> Result<(), Error>
pub fn path_symlink(
&self,
old_path: &GuestPtr<'a, str>,
fd: Fd,
new_path: &GuestPtr<'a, str>
) -> Result<(), Error>
pub fn path_unlink_file(
&self,
fd: Fd,
path: &GuestPtr<'a, str>
) -> Result<(), Error>
pub fn poll_oneoff(
&self,
in_: &GuestPtr<'a, Subscription>,
out: &GuestPtr<'a, Event>,
nsubscriptions: u32
) -> Result<u32, Error>
pub fn proc_exit(&self, rval: u32) -> Result<(), ()>
pub fn proc_raise(&self, sig: Signal) -> Result<(), Error>
pub fn sched_yield(&self) -> Result<(), Error>
pub fn random_get(
&self,
buf: &GuestPtr<'a, u8>,
buf_len: u32
) -> Result<(), Error>
pub fn sock_recv(
&self,
fd: Fd,
ri_data: &GuestPtr<'a, [Iovec<'a>]>,
ri_flags: Riflags
) -> Result<(u32, Roflags), Error>
pub fn sock_send(
&self,
fd: Fd,
si_data: &GuestPtr<'a, [Ciovec<'a>]>,
si_flags: u16
) -> Result<u32, Error>
pub fn sock_shutdown(&self, fd: Fd, how: Sdflags) -> Result<(), Error>
Auto Trait Implementations
impl !RefUnwindSafe for WasiCtx
impl !Send for WasiCtx
impl !Sync for WasiCtx
impl Unpin for WasiCtx
impl !UnwindSafe for WasiCtx
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