pub struct CgiConfig { /* private fields */ }Expand description
Configuration for a CGI service.
Use the builder methods to customize the CGI execution environment.
Implementations§
Source§impl CgiConfig
impl CgiConfig
Sourcepub fn new(command: impl Into<String>) -> Self
pub fn new(command: impl Into<String>) -> Self
Creates a new configuration with the given command path.
Sourcepub fn args(self, args: Vec<String>) -> Self
pub fn args(self, args: Vec<String>) -> Self
Sets command-line arguments to pass to the CGI script.
Sourcepub fn working_dir(self, dir: impl Into<String>) -> Self
pub fn working_dir(self, dir: impl Into<String>) -> Self
Sets the working directory for the CGI process.
Sourcepub fn env(self, key: impl Into<String>, value: impl Into<String>) -> Self
pub fn env(self, key: impl Into<String>, value: impl Into<String>) -> Self
Adds an environment variable to pass to the CGI process.
Sourcepub fn server_software(self, software: impl Into<String>) -> Self
pub fn server_software(self, software: impl Into<String>) -> Self
Sets the SERVER_SOFTWARE meta-variable.
Sourcepub fn server_name(self, name: impl Into<String>) -> Self
pub fn server_name(self, name: impl Into<String>) -> Self
Sets the SERVER_NAME meta-variable.
Sourcepub fn server_port(self, port: u16) -> Self
pub fn server_port(self, port: u16) -> Self
Sets the SERVER_PORT meta-variable.
Sourcepub fn https(self, https: bool) -> Self
pub fn https(self, https: bool) -> Self
Set whether the request was received over HTTPS. When true, sets the HTTPS environment variable to “on”.
Sourcepub fn inherit_env(self, vars: Vec<String>) -> Self
pub fn inherit_env(self, vars: Vec<String>) -> Self
Sets environment variables to inherit from the parent process.
Sourcepub fn inherit(self, var: impl Into<String>) -> Self
pub fn inherit(self, var: impl Into<String>) -> Self
Adds a single environment variable to inherit from the parent process.
Sourcepub fn script_name(self, name: impl Into<String>) -> Self
pub fn script_name(self, name: impl Into<String>) -> Self
When set, PATH_INFO will be computed as the request path minus this script name.
Sourcepub fn document_root(self, root: impl Into<String>) -> Self
pub fn document_root(self, root: impl Into<String>) -> Self
Set the document root for computing PATH_TRANSLATED. When PATH_INFO is non-empty, PATH_TRANSLATED = document_root + PATH_INFO.
Sourcepub fn pass_through_stderr(self, pass_through: bool) -> Self
pub fn pass_through_stderr(self, pass_through: bool) -> Self
Sets whether to pass through CGI process stderr to the parent process.