silk.platform.wasi.host_input.
A snapshot of WASI command arguments and environment variables.
When to use#
Use WasiHostInput.capture to provide HostInput inside a WASI command.
The WASI runtime supplies this provider to an application that requires HostInput.
Details#
The snapshot owns its bytes. The working directory is / in the guest namespace.
The host grants filesystem access separately through preopened directories.
Import as WasiHostInput with import silk.platform.wasi.host_input { WasiHostInput }.
Public declarations: 1.
WasiHostInput#
pub struct WasiHostInputA WASI HostInput provider that owns command arguments and environment bytes.
The working directory is / in the guest namespace.
Implementation WasiHostInput#
impl WasiHostInputAssociated function capture#
pub effect fn capture() -> WasiHostInput
! HostInputError | OutOfMemoryError
? &mut AllocatorCopies the host's command arguments and environment into an owned snapshot.
Fails with HostInputError on a host error, or OutOfMemoryError on an allocation failure.
Implementation HostInput for WasiHostInput#
impl HostInput for WasiHostInputOperation argumentCount#
effect fn argumentCount(self: &mut Self) -> usize
! HostInputErrorOperation argument#
effect fn argument(self: &mut Self, index: usize) -> Option<Bytes>
! HostInputError | OutOfMemoryError
? &mut AllocatorOperation variable#
effect fn variable(self: &mut Self, name: &[u8]) -> Option<Bytes>
! HostInputError | OutOfMemoryError
? &mut AllocatorOperation workingDirectory#
effect fn workingDirectory(self: &mut Self) -> Bytes
! HostInputError | OutOfMemoryError
? &mut AllocatorCategory: Native platform.
Profiles: wasm32-wasip1, wasm32-wasip2.