pub struct ListenerBuilder {
Show 18 fields pub address: String, pub protocol: Option<ListenerProtocol>, pub public_address: Option<String>, pub answer_404: Option<String>, pub answer_503: Option<String>, pub tls_versions: Option<Vec<TlsVersion>>, pub cipher_list: Option<Vec<String>>, pub cipher_suites: Option<Vec<String>>, pub expect_proxy: Option<bool>, pub sticky_name: String, pub certificate: Option<String>, pub certificate_chain: Option<String>, pub key: Option<String>, pub front_timeout: Option<u32>, pub back_timeout: Option<u32>, pub connect_timeout: Option<u32>, pub request_timeout: Option<u32>, pub config: Option<Config>,
}
Expand description

An HTTP, HTTPS or TCP listener as parsed from the Listeners section in the toml

Fields§

§address: String§protocol: Option<ListenerProtocol>§public_address: Option<String>§answer_404: Option<String>

path to the 404 html file

§answer_503: Option<String>

path to the 503 html file

§tls_versions: Option<Vec<TlsVersion>>§cipher_list: Option<Vec<String>>§cipher_suites: Option<Vec<String>>§expect_proxy: Option<bool>§sticky_name: String§certificate: Option<String>§certificate_chain: Option<String>§key: Option<String>§front_timeout: Option<u32>

maximum time of inactivity for a frontend socket

§back_timeout: Option<u32>

maximum time of inactivity for a backend socket

§connect_timeout: Option<u32>

maximum time to connect to a backend server

§request_timeout: Option<u32>

maximum time to receive a request since the connection started

§config: Option<Config>

A Config to pull defaults from

Implementations§

source§

impl ListenerBuilder

source

pub fn new_http<S>(address: S) -> ListenerBuilderwhere S: ToString,

starts building an HTTP Listener with config values for timeouts, or defaults if no config is provided

source

pub fn new_tcp<S>(address: S) -> ListenerBuilderwhere S: ToString,

starts building an HTTPS Listener with config values for timeouts, or defaults if no config is provided

source

pub fn new_https<S>(address: S) -> ListenerBuilderwhere S: ToString,

starts building a TCP Listener with config values for timeouts, or defaults if no config is provided

source

pub fn with_public_address<S>(&mut self, public_address: Option<S>) -> &mut Selfwhere S: ToString,

source

pub fn with_answer_404_path<S>( &mut self, answer_404_path: Option<S> ) -> &mut Selfwhere S: ToString,

source

pub fn with_answer_503_path<S>( &mut self, answer_503_path: Option<S> ) -> &mut Selfwhere S: ToString,

source

pub fn with_tls_versions(&mut self, tls_versions: Vec<TlsVersion>) -> &mut Self

source

pub fn with_cipher_list( &mut self, cipher_list: Option<Vec<String>> ) -> &mut Self

source

pub fn with_cipher_suites( &mut self, cipher_suites: Option<Vec<String>> ) -> &mut Self

source

pub fn with_expect_proxy(&mut self, expect_proxy: bool) -> &mut Self

source

pub fn with_sticky_name<S>(&mut self, sticky_name: Option<S>) -> &mut Selfwhere S: ToString,

source

pub fn with_certificate<S>(&mut self, certificate: S) -> &mut Selfwhere S: ToString,

source

pub fn with_certificate_chain(&mut self, certificate_chain: String) -> &mut Self

source

pub fn with_key<S>(&mut self, key: String) -> &mut Selfwhere S: ToString,

source

pub fn with_front_timeout(&mut self, front_timeout: Option<u32>) -> &mut Self

source

pub fn with_back_timeout(&mut self, back_timeout: Option<u32>) -> &mut Self

source

pub fn with_connect_timeout( &mut self, connect_timeout: Option<u32> ) -> &mut Self

source

pub fn with_request_timeout( &mut self, request_timeout: Option<u32> ) -> &mut Self

source

pub fn parse_address(&self) -> Result<SocketAddr>

source

pub fn parse_public_address(&self) -> Result<Option<SocketAddr>>

source

pub fn to_http(&mut self, config: Option<&Config>) -> Result<HttpListenerConfig>

build an HTTP listener with config timeouts, using defaults if no config is provided

source

pub fn to_tls(&mut self, config: Option<&Config>) -> Result<HttpsListenerConfig>

build an HTTPS listener using defaults if no config or values were provided upstream

source

pub fn to_tcp(&mut self, config: Option<&Config>) -> Result<TcpListenerConfig>

build an HTTPS listener using defaults if no config or values were provided upstream

Trait Implementations§

source§

impl Clone for ListenerBuilder

source§

fn clone(&self) -> ListenerBuilder

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for ListenerBuilder

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for ListenerBuilder

source§

fn default() -> ListenerBuilder

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

impl<'de> Deserialize<'de> for ListenerBuilder

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl PartialEq<ListenerBuilder> for ListenerBuilder

source§

fn eq(&self, other: &ListenerBuilder) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Serialize for ListenerBuilder

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl Eq for ListenerBuilder

source§

impl StructuralEq for ListenerBuilder

source§

impl StructuralPartialEq for ListenerBuilder

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
§

impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

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

source§

impl<T> Reset for Twhere T: Default + Clone,

source§

fn reset(&mut self)

source§

impl<T> Reset for Twhere T: Default + Clone,

source§

fn reset(&mut self)

source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere V: MultiLane<T>,

§

fn vzip(self) -> V

source§

impl<T> DeserializeOwned for Twhere T: for<'de> Deserialize<'de>,