Class WasiConfiguration
Represents a WASI configuration.
Inheritance
Namespace: Wasmtime
Assembly: Wasmtime.Dotnet.dll
Syntax
public class WasiConfiguration : object
Methods
| Improve this Doc View SourceWithArg(String)
Adds a command line argument to the configuration.
Declaration
public WasiConfiguration WithArg(string arg)
Parameters
Type | Name | Description |
---|---|---|
System.String | arg | The command line argument to add. |
Returns
Type | Description |
---|---|
WasiConfiguration | Returns the current configuration. |
WithArgs(IEnumerable<String>)
Adds multiple command line arguments to the configuration.
Declaration
public WasiConfiguration WithArgs(IEnumerable<string> args)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<System.String> | args | The command line arguments to add. |
Returns
Type | Description |
---|---|
WasiConfiguration | Returns the current configuration. |
WithArgs(ReadOnlySpan<String>)
Adds multiple command line arguments to the configuration.
Declaration
public WasiConfiguration WithArgs(ReadOnlySpan<string> args)
Parameters
Type | Name | Description |
---|---|---|
ReadOnlySpan<System.String> | args | The command line arguments to add. |
Returns
Type | Description |
---|---|
WasiConfiguration | Returns the current configuration. |
WithArgs(String[])
Adds multiple command line arguments to the configuration.
Declaration
public WasiConfiguration WithArgs(params string[] args)
Parameters
Type | Name | Description |
---|---|---|
System.String[] | args | The command line arguments to add. |
Returns
Type | Description |
---|---|
WasiConfiguration | Returns the current configuration. |
WithEnvironmentVariable(String, String)
Adds an environment variable to the configuration.
Declaration
public WasiConfiguration WithEnvironmentVariable(string name, string value)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | The name of the environment variable. |
System.String | value | The value of the environment variable. |
Returns
Type | Description |
---|---|
WasiConfiguration | Returns the current configuration. |
WithEnvironmentVariables(IEnumerable<(String, String)>)
Adds multiple environment variables to the configuration.
Declaration
public WasiConfiguration WithEnvironmentVariables(IEnumerable<(string, string)> vars)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<System.ValueTuple<System.String, System.String>> | vars | The name-value tuples of the environment variables to add. |
Returns
Type | Description |
---|---|
WasiConfiguration | Returns the current configuration. |
WithInheritedArgs()
Sets the configuration to inherit command line arguments.
Declaration
public WasiConfiguration WithInheritedArgs()
Returns
Type | Description |
---|---|
WasiConfiguration | Returns the current configuration. |
Remarks
Any explicitly specified command line arguments will be removed.
WithInheritedEnvironment()
Sets the configuration to inherit environment variables.
Declaration
public WasiConfiguration WithInheritedEnvironment()
Returns
Type | Description |
---|---|
WasiConfiguration | Returns the current configuration. |
Remarks
Any explicitly specified environment variables will be removed.
WithInheritedStandardError()
Sets the configuration to inherit stderr.
Declaration
public WasiConfiguration WithInheritedStandardError()
Returns
Type | Description |
---|---|
WasiConfiguration | Returns the current configuration. |
Remarks
Any explicitly specified stderr file will be removed.
WithInheritedStandardInput()
Sets the configuration to inherit stdin.
Declaration
public WasiConfiguration WithInheritedStandardInput()
Returns
Type | Description |
---|---|
WasiConfiguration | Returns the current configuration. |
Remarks
Any explicitly specified stdin file will be removed.
WithInheritedStandardOutput()
Sets the configuration to inherit stdout.
Declaration
public WasiConfiguration WithInheritedStandardOutput()
Returns
Type | Description |
---|---|
WasiConfiguration | Returns the current configuration. |
Remarks
Any explicitly specified stdout file will be removed.
WithPreopenedDirectory(String, String)
Adds a preopen directory to the configuration.
Declaration
public WasiConfiguration WithPreopenedDirectory(string path, string guestPath)
Parameters
Type | Name | Description |
---|---|---|
System.String | path | The path to the directory to add. |
System.String | guestPath | The path the guest will use to open the directory. |
Returns
Type | Description |
---|---|
WasiConfiguration | Returns the current configuration. |
WithStandardError(String)
Sets the configuration to use the given file path as stderr.
Declaration
public WasiConfiguration WithStandardError(string path)
Parameters
Type | Name | Description |
---|---|---|
System.String | path | The file to use as stderr. |
Returns
Type | Description |
---|---|
WasiConfiguration | Returns the current configuration. |
WithStandardInput(String)
Sets the configuration to use the given file path as stdin.
Declaration
public WasiConfiguration WithStandardInput(string path)
Parameters
Type | Name | Description |
---|---|---|
System.String | path | The file to use as stdin. |
Returns
Type | Description |
---|---|
WasiConfiguration | Returns the current configuration. |
WithStandardOutput(String)
Sets the configuration to use the given file path as stdout.
Declaration
public WasiConfiguration WithStandardOutput(string path)
Parameters
Type | Name | Description |
---|---|---|
System.String | path | The file to use as stdout. |
Returns
Type | Description |
---|---|
WasiConfiguration | Returns the current configuration. |