Struct wasmtime_wasi::WasiCtx[][src]

pub struct WasiCtx {
    pub args: StringArray,
    pub env: StringArray,
    pub random: RefCell<Box<dyn RngCore + 'static, Global>>,
    pub clocks: WasiClocks,
    pub sched: Box<dyn WasiSched + 'static, Global>,
    pub table: Rc<RefCell<Table>>,
}

Fields

args: StringArrayenv: StringArrayrandom: RefCell<Box<dyn RngCore + 'static, Global>>clocks: WasiClockssched: Box<dyn WasiSched + 'static, Global>table: Rc<RefCell<Table>>

Implementations

impl WasiCtx[src]

pub fn builder(
    random: RefCell<Box<dyn RngCore + 'static, Global>>,
    clocks: WasiClocks,
    sched: Box<dyn WasiSched + 'static, Global>,
    table: Rc<RefCell<Table>>
) -> WasiCtxBuilder
[src]

pub fn insert_file(
    &self,
    fd: u32,
    file: Box<dyn WasiFile + 'static, Global>,
    caps: FileCaps
)
[src]

pub fn insert_dir(
    &self,
    fd: u32,
    dir: Box<dyn WasiDir + 'static, Global>,
    caps: DirCaps,
    file_caps: FileCaps,
    path: PathBuf
)
[src]

pub fn table(&self) -> RefMut<'_, Table>[src]

Trait Implementations

impl UserErrorConversion for WasiCtx[src]

impl UserErrorConversion for WasiCtx[src]

impl<'a> WasiSnapshotPreview1 for WasiCtx[src]

pub fn args_get(
    &self,
    argv: &GuestPtr<'b, GuestPtr<'b, u8>>,
    argv_buf: &GuestPtr<'b, u8>
) -> Result<(), Error>
[src]

pub fn args_sizes_get(&self) -> Result<(u32, u32), Error>[src]

pub fn environ_get(
    &self,
    environ: &GuestPtr<'b, GuestPtr<'b, u8>>,
    environ_buf: &GuestPtr<'b, u8>
) -> Result<(), Error>
[src]

pub fn environ_sizes_get(&self) -> Result<(u32, u32), Error>[src]

pub fn clock_res_get(&self, id: Clockid) -> Result<u64, Error>[src]

pub fn clock_time_get(&self, id: Clockid, precision: u64) -> Result<u64, Error>[src]

pub fn fd_advise(
    &self,
    fd: Fd,
    offset: u64,
    len: u64,
    advice: Advice
) -> Result<(), Error>
[src]

pub fn fd_allocate(&self, fd: Fd, offset: u64, len: u64) -> Result<(), Error>[src]

pub fn fd_close(&self, fd: Fd) -> Result<(), Error>[src]

pub fn fd_datasync(&self, fd: Fd) -> Result<(), Error>[src]

pub fn fd_fdstat_get(&self, fd: Fd) -> Result<Fdstat, Error>[src]

pub fn fd_fdstat_set_flags(&self, fd: Fd, flags: Fdflags) -> Result<(), Error>[src]

pub fn fd_fdstat_set_rights(
    &self,
    fd: Fd,
    fs_rights_base: Rights,
    fs_rights_inheriting: Rights
) -> Result<(), Error>
[src]

pub fn fd_filestat_get(&self, fd: Fd) -> Result<Filestat, Error>[src]

pub fn fd_filestat_set_size(&self, fd: Fd, size: u64) -> Result<(), Error>[src]

pub fn fd_filestat_set_times(
    &self,
    fd: Fd,
    atim: u64,
    mtim: u64,
    fst_flags: Fstflags
) -> Result<(), Error>
[src]

pub fn fd_read(
    &self,
    fd: Fd,
    iovs: &GuestPtr<'_, [Iovec<'_>]>
) -> Result<u32, Error>
[src]

pub fn fd_pread(
    &self,
    fd: Fd,
    iovs: &GuestPtr<'_, [Iovec<'_>]>,
    offset: u64
) -> Result<u32, Error>
[src]

pub fn fd_write(
    &self,
    fd: Fd,
    ciovs: &GuestPtr<'_, [Ciovec<'_>]>
) -> Result<u32, Error>
[src]

pub fn fd_pwrite(
    &self,
    fd: Fd,
    ciovs: &GuestPtr<'_, [Ciovec<'_>]>,
    offset: u64
) -> Result<u32, Error>
[src]

pub fn fd_prestat_get(&self, fd: Fd) -> Result<Prestat, Error>[src]

pub fn fd_prestat_dir_name(
    &self,
    fd: Fd,
    path: &GuestPtr<'_, u8>,
    path_max_len: u32
) -> Result<(), Error>
[src]

pub fn fd_renumber(&self, from: Fd, to: Fd) -> Result<(), Error>[src]

pub fn fd_seek(&self, fd: Fd, offset: i64, whence: Whence) -> Result<u64, Error>[src]

pub fn fd_sync(&self, fd: Fd) -> Result<(), Error>[src]

pub fn fd_tell(&self, fd: Fd) -> Result<u64, Error>[src]

pub fn fd_readdir(
    &self,
    fd: Fd,
    buf: &GuestPtr<'_, u8>,
    buf_len: u32,
    cookie: u64
) -> Result<u32, Error>
[src]

pub fn path_create_directory(
    &self,
    dirfd: Fd,
    path: &GuestPtr<'_, str>
) -> Result<(), Error>
[src]

pub fn path_filestat_get(
    &self,
    dirfd: Fd,
    flags: Lookupflags,
    path: &GuestPtr<'_, str>
) -> Result<Filestat, Error>
[src]

pub fn path_filestat_set_times(
    &self,
    dirfd: Fd,
    flags: Lookupflags,
    path: &GuestPtr<'_, str>,
    atim: u64,
    mtim: u64,
    fst_flags: Fstflags
) -> Result<(), Error>
[src]

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>
[src]

pub fn path_remove_directory(
    &self,
    dirfd: Fd,
    path: &GuestPtr<'_, str>
) -> Result<(), Error>
[src]

pub fn path_rename(
    &self,
    src_fd: Fd,
    src_path: &GuestPtr<'_, str>,
    dest_fd: Fd,
    dest_path: &GuestPtr<'_, str>
) -> Result<(), Error>
[src]

pub fn poll_oneoff(
    &self,
    subs: &GuestPtr<'_, Subscription>,
    events: &GuestPtr<'_, Event>,
    nsubscriptions: u32
) -> Result<u32, Error>
[src]

pub fn proc_exit(&self, status: u32) -> Trap[src]

pub fn proc_raise(&self, _sig: Signal) -> Result<(), Error>[src]

pub fn sched_yield(&self) -> Result<(), Error>[src]

pub fn random_get(
    &self,
    buf: &GuestPtr<'_, u8>,
    buf_len: u32
) -> Result<(), Error>
[src]

pub fn sock_recv(
    &self,
    _fd: Fd,
    _ri_data: &GuestPtr<'_, [Iovec<'_>]>,
    _ri_flags: Riflags
) -> Result<(u32, Roflags), Error>
[src]

pub fn sock_send(
    &self,
    _fd: Fd,
    _si_data: &GuestPtr<'_, [Ciovec<'_>]>,
    _si_flags: u16
) -> Result<u32, Error>
[src]

pub fn sock_shutdown(&self, _fd: Fd, _how: Sdflags) -> Result<(), Error>[src]

impl<'a> WasiUnstable for WasiCtx[src]

pub fn args_get(
    &self,
    argv: &GuestPtr<'b, GuestPtr<'b, u8>>,
    argv_buf: &GuestPtr<'b, u8>
) -> Result<(), Error>
[src]

pub fn args_sizes_get(&self) -> Result<(u32, u32), Error>[src]

pub fn environ_get(
    &self,
    environ: &GuestPtr<'b, GuestPtr<'b, u8>>,
    environ_buf: &GuestPtr<'b, u8>
) -> Result<(), Error>
[src]

pub fn environ_sizes_get(&self) -> Result<(u32, u32), Error>[src]

pub fn clock_res_get(&self, id: Clockid) -> Result<u64, Error>[src]

pub fn clock_time_get(&self, id: Clockid, precision: u64) -> Result<u64, Error>[src]

pub fn fd_advise(
    &self,
    fd: Fd,
    offset: u64,
    len: u64,
    advice: Advice
) -> Result<(), Error>
[src]

pub fn fd_allocate(&self, fd: Fd, offset: u64, len: u64) -> Result<(), Error>[src]

pub fn fd_close(&self, fd: Fd) -> Result<(), Error>[src]

pub fn fd_datasync(&self, fd: Fd) -> Result<(), Error>[src]

pub fn fd_fdstat_get(&self, fd: Fd) -> Result<Fdstat, Error>[src]

pub fn fd_fdstat_set_flags(&self, fd: Fd, flags: Fdflags) -> Result<(), Error>[src]

pub fn fd_fdstat_set_rights(
    &self,
    fd: Fd,
    fs_rights_base: Rights,
    fs_rights_inheriting: Rights
) -> Result<(), Error>
[src]

pub fn fd_filestat_get(&self, fd: Fd) -> Result<Filestat, Error>[src]

pub fn fd_filestat_set_size(&self, fd: Fd, size: u64) -> Result<(), Error>[src]

pub fn fd_filestat_set_times(
    &self,
    fd: Fd,
    atim: u64,
    mtim: u64,
    fst_flags: Fstflags
) -> Result<(), Error>
[src]

pub fn fd_read(
    &self,
    fd: Fd,
    iovs: &GuestPtr<'_, [Iovec<'_>]>
) -> Result<u32, Error>
[src]

pub fn fd_pread(
    &self,
    fd: Fd,
    iovs: &GuestPtr<'_, [Iovec<'_>]>,
    offset: u64
) -> Result<u32, Error>
[src]

pub fn fd_write(
    &self,
    fd: Fd,
    ciovs: &GuestPtr<'_, [Ciovec<'_>]>
) -> Result<u32, Error>
[src]

pub fn fd_pwrite(
    &self,
    fd: Fd,
    ciovs: &GuestPtr<'_, [Ciovec<'_>]>,
    offset: u64
) -> Result<u32, Error>
[src]

pub fn fd_prestat_get(&self, fd: Fd) -> Result<Prestat, Error>[src]

pub fn fd_prestat_dir_name(
    &self,
    fd: Fd,
    path: &GuestPtr<'_, u8>,
    path_max_len: u32
) -> Result<(), Error>
[src]

pub fn fd_renumber(&self, from: Fd, to: Fd) -> Result<(), Error>[src]

pub fn fd_seek(&self, fd: Fd, offset: i64, whence: Whence) -> Result<u64, Error>[src]

pub fn fd_sync(&self, fd: Fd) -> Result<(), Error>[src]

pub fn fd_tell(&self, fd: Fd) -> Result<u64, Error>[src]

pub fn fd_readdir(
    &self,
    fd: Fd,
    buf: &GuestPtr<'_, u8>,
    buf_len: u32,
    cookie: u64
) -> Result<u32, Error>
[src]

pub fn path_create_directory(
    &self,
    dirfd: Fd,
    path: &GuestPtr<'_, str>
) -> Result<(), Error>
[src]

pub fn path_filestat_get(
    &self,
    dirfd: Fd,
    flags: Lookupflags,
    path: &GuestPtr<'_, str>
) -> Result<Filestat, Error>
[src]

pub fn path_filestat_set_times(
    &self,
    dirfd: Fd,
    flags: Lookupflags,
    path: &GuestPtr<'_, str>,
    atim: u64,
    mtim: u64,
    fst_flags: Fstflags
) -> Result<(), Error>
[src]

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>
[src]

pub fn path_remove_directory(
    &self,
    dirfd: Fd,
    path: &GuestPtr<'_, str>
) -> Result<(), Error>
[src]

pub fn path_rename(
    &self,
    src_fd: Fd,
    src_path: &GuestPtr<'_, str>,
    dest_fd: Fd,
    dest_path: &GuestPtr<'_, str>
) -> Result<(), Error>
[src]

pub fn poll_oneoff(
    &self,
    subs: &GuestPtr<'_, Subscription>,
    events: &GuestPtr<'_, Event>,
    nsubscriptions: u32
) -> Result<u32, Error>
[src]

pub fn proc_exit(&self, status: u32) -> Trap[src]

pub fn proc_raise(&self, _sig: Signal) -> Result<(), Error>[src]

pub fn sched_yield(&self) -> Result<(), Error>[src]

pub fn random_get(
    &self,
    buf: &GuestPtr<'_, u8>,
    buf_len: u32
) -> Result<(), Error>
[src]

pub fn sock_recv(
    &self,
    _fd: Fd,
    _ri_data: &GuestPtr<'_, [Iovec<'_>]>,
    _ri_flags: Riflags
) -> Result<(u32, Roflags), Error>
[src]

pub fn sock_send(
    &self,
    _fd: Fd,
    _si_data: &GuestPtr<'_, [Ciovec<'_>]>,
    _si_flags: u16
) -> Result<u32, Error>
[src]

pub fn sock_shutdown(&self, _fd: Fd, _how: Sdflags) -> Result<(), Error>[src]

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

impl<T> Any for T where
    T: 'static + ?Sized
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T> Instrument for T[src]

fn instrument(self, span: Span) -> Instrumented<Self>[src]

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

fn in_current_span(self) -> Instrumented<Self>[src]

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<T> Pointee for T[src]

type Pointer = u32

pub fn debug(
    pointer: <T as Pointee>::Pointer,
    f: &mut Formatter<'_>
) -> Result<(), Error>
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

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

Performs the conversion.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 

pub fn vzip(self) -> V