WasiOptions Class
Options of a WasiContext: what the module sees of its environment.
public sealed class WasiOptionsConstructors
| Name | Description |
|---|---|
| WasiOptions() |
WasiOptions()
WasiOptions.cspublic WasiOptions()No documentation is available.
Properties
| Name | Description |
|---|---|
| Arguments | Gets the command-line arguments of the module (args_get). By convention, the first argument is the name of the program. The default is no argument. |
| EnvironmentVariables | Gets the environment variables of the module (environ_get). The default is no variable. |
| HttpClient | Gets the HTTP client of a component (wasi:http/client of WASI 0.3), or null for a component that cannot send requests: they fail with HTTP-request-denied. Use WasiHostHttpClient to send the requests over the network of the machine (with the rules of the requests the component can send), or WasiInMemoryHttpClient to give them to a handler of the process. |
| Network | Gets the network of a component (wasi:sockets of WASI 0.3), or null for a component without network: its sockets fail with access-denied. Use WasiHostNetwork for the network of the machine (with the rules of what the component can access), or WasiInMemoryNetwork for a network inside the process. The modules of WASI Preview 1 have no sockets. |
| PreopenedDirectories | Gets the directories that the module can access, as the file descriptors 3, 4, ... in this order. The module can access no file outside of these directories. The default is no directory. |
| RandomSource | Gets the source of the random bytes of the module (random_get), or null to use RandomNumberGenerator.Fill. |
| StandardError | Gets the stream where the module writes its standard error (file descriptor 2), or null to discard the output. |
| StandardInput | Gets the stream that the module reads as its standard input (file descriptor 0), or null for an empty input. |
| StandardOutput | Gets the stream where the module writes its standard output (file descriptor 1), or null to discard the output. |
| TimeProvider | Gets the clock of the module: the realtime clock is TimeProvider.GetUtcNow, the monotonic clock is TimeProvider.GetTimestamp, and poll_oneoff waits with TimeProvider.CreateTimer. The default is TimeProvider.System. |
Arguments
WasiOptions.csGets the command-line arguments of the module (args_get). By convention, the first argument is the name of the program. The default is no argument.
Property value
EnvironmentVariables
WasiOptions.csGets the environment variables of the module (environ_get). The default is no variable.
public IDictionary<string, string> EnvironmentVariables { get; init; }Property value
HttpClient
WasiOptions.csGets the HTTP client of a component (wasi:http/client of WASI 0.3), or null for a component that cannot send requests: they fail with HTTP-request-denied. Use WasiHostHttpClient to send the requests over the network of the machine (with the rules of the requests the component can send), or WasiInMemoryHttpClient to give them to a handler of the process.
public WasiHttpClient? HttpClient { get; init; }Property value
Network
WasiOptions.csGets the network of a component (wasi:sockets of WASI 0.3), or null for a component without network: its sockets fail with access-denied. Use WasiHostNetwork for the network of the machine (with the rules of what the component can access), or WasiInMemoryNetwork for a network inside the process. The modules of WASI Preview 1 have no sockets.
public WasiNetwork? Network { get; init; }Property value
PreopenedDirectories
WasiOptions.csGets the directories that the module can access, as the file descriptors 3, 4, ... in this order. The module can access no file outside of these directories. The default is no directory.
public IList<WasiPreopenedDirectory> PreopenedDirectories { get; init; }Property value
RandomSource
WasiOptions.csGets the source of the random bytes of the module (random_get), or null to use RandomNumberGenerator.Fill.
public WasiRandomSource? RandomSource { get; init; }Property value
StandardError
WasiOptions.csStandardInput
WasiOptions.csStandardOutput
WasiOptions.csTimeProvider
WasiOptions.csGets the clock of the module: the realtime clock is TimeProvider.GetUtcNow, the monotonic clock is TimeProvider.GetTimestamp, and poll_oneoff waits with TimeProvider.CreateTimer. The default is TimeProvider.System.
public TimeProvider TimeProvider { get; init; }