Struct cotoxy::ProxyServerBuilder
[−]
[src]
pub struct ProxyServerBuilder { /* fields omitted */ }
A builder for ProxyServer
.
Methods
impl ProxyServerBuilder
[src]
const DEFAULT_BIND_ADDR: &'static str
DEFAULT_BIND_ADDR: &'static str = "0.0.0.0:17382"
The default address to which the proxy server bind.
const DEFAULT_CONNECT_TIMEOUT_MS: u64
DEFAULT_CONNECT_TIMEOUT_MS: u64 = 1000
The default timeout of a TCP connect operation.
fn new(service: &str) -> Self
[src]
Makes a new ProxyServerBuilder
for the given service.
fn logger(&mut self, logger: Logger) -> &mut Self
[src]
Sets the logger of the server.
The default value is Logger::root(Discard, o!())
.
fn bind_addr(&mut self, addr: SocketAddr) -> &mut Self
[src]
Sets the address to which the server bind.
The default value is ProxyServerBuilder::DEFAULT_BIND_ADDR
.
fn service_port(&mut self, port: u16) -> &mut Self
[src]
Sets the port number of the service handled by the proxy server.
If omitted, the value of the selected node's ServicePort
field registered in Consul will be used.
fn connect_timeout(&mut self, timeout: Duration) -> &mut Self
[src]
Sets the timeout of a TCP connect operation.
The default value is Duration::from_millis(ProxyServerBuilder::DEFAULT_CONNECT_TIMEOUT_MS)
.
fn consul(&mut self) -> &mut ConsulSettings
[src]
Returns the mutable reference to ConsulClientBuilder
.
fn finish<S: Spawn>(&self, spawner: S) -> ProxyServer<S>
[src]
Builds a new proxy server with the specified settings.
Trait Implementations
impl Debug for ProxyServerBuilder
[src]
impl Clone for ProxyServerBuilder
[src]
fn clone(&self) -> ProxyServerBuilder
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more