pub struct ServerListenConfig {
    pub host: Option<BindAddress>,
    pub port: Option<PortRange>,
    pub use_ipv6: bool,
    pub shutdown_after: Option<f32>,
    pub current_dir: Option<PathBuf>,
}

Fields

host: Option<BindAddress>

Control the IP address that the distant binds to

There are three options here:

  1. ssh: the server will reply from the IP address that the SSH connection came from (as found in the SSH_CONNECTION environment variable). This is useful for multihomed servers.

  2. any: the server will reply on the default interface and will not bind to a particular IP address. This can be useful if the connection is made through ssh or another tool that makes the SSH connection appear to come from localhost.

  3. IP: the server will attempt to bind to the specified IP address.

port: Option<PortRange>

Set the port(s) that the server will attempt to bind to

This can be in the form of PORT1 or PORT1:PORTN to provide a range of ports. With --port 0, the server will let the operating system pick an available TCP port.

Please note that this option does not affect the server-side port used by SSH

use_ipv6: bool

If specified, will bind to the ipv6 interface if host is “any” instead of ipv4

shutdown_after: Option<f32>

The time in seconds before shutting down the server if there are no active connections. The countdown begins once all connections have closed and stops when a new connection is made. In not specified, the server will not shutdown at any point when there are no active connections.

current_dir: Option<PathBuf>

Changes the current working directory (cwd) to the specified directory

Trait Implementations

Append to Command so it can instantiate Self. Read more

Append to Command so it can update self. Read more

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

Deserialize this value from the given Serde deserializer. Read more

Converts to this type from the input type.

Converts to this type from the input type.

Instantiate Self from ArgMatches, parsing the arguments as needed. Read more

Instantiate Self from ArgMatches, parsing the arguments as needed. Read more

Assign values from ArgMatches to self.

Assign values from ArgMatches to self.

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Converts reference to Any

Converts mutable reference to Any

Consumes and produces Box<dyn Any>

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Applies the [Compat] adapter by value. Read more

Applies the [Compat] adapter by shared reference. Read more

Applies the [Compat] adapter by mutable reference. Read more

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Should always be Self

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more