In the previous example, we used a value of the RUST_LOG environment variable to set filtering parameters for logging. We can use other environment variables to set parameters for our server as well. In the following example, we will use the ADDRESS environment variable to set the address of the socket we want to bind.
Reading environment variables
Standard library
There are enough functions in the std::env standard module to work with environment variables. It contains the var function to read external values. This function returns a Result with a String value of the variable if it exists, or a VarError error if it doesn't exist. Add the import of the env module to your main...