Struct ListenerBuilder

Source
pub struct ListenerBuilder {
Show 27 fields pub address: SocketAddr, pub protocol: Option<ListenerProtocol>, pub public_address: Option<SocketAddr>, pub answer_301: Option<String>, pub answer_400: Option<String>, pub answer_401: Option<String>, pub answer_404: Option<String>, pub answer_408: Option<String>, pub answer_413: Option<String>, pub answer_502: Option<String>, pub answer_503: Option<String>, pub answer_504: Option<String>, pub answer_507: 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>, pub send_tls13_tickets: Option<u64>,
}
Expand description

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

Fields§

§address: SocketAddr§protocol: Option<ListenerProtocol>§public_address: Option<SocketAddr>§answer_301: Option<String>§answer_400: Option<String>§answer_401: Option<String>§answer_404: Option<String>§answer_408: Option<String>§answer_413: Option<String>§answer_502: Option<String>§answer_503: Option<String>§answer_504: Option<String>§answer_507: Option<String>§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

§send_tls13_tickets: Option<u64>

Number of TLS 1.3 tickets to send to a client when establishing a connection. The ticket allow the client to resume a session. This protects the client agains session tracking. Defaults to 4.

Implementations§

Source§

impl ListenerBuilder

Source

pub fn new_http(address: SocketAddress) -> ListenerBuilder

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

Source

pub fn new_tcp(address: SocketAddress) -> ListenerBuilder

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

Source

pub fn new_https(address: SocketAddress) -> ListenerBuilder

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

Source

pub fn with_public_address( &mut self, public_address: Option<SocketAddr>, ) -> &mut Self

Source

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

Source

pub fn with_answer_503_path<S>( &mut self, answer_503_path: Option<S>, ) -> &mut Self
where 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 Self
where S: ToString,

Source

pub fn with_certificate<S>(&mut self, certificate: S) -> &mut Self
where 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 Self
where 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 to_http( &mut self, config: Option<&Config>, ) -> Result<HttpListenerConfig, ConfigError>

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, ConfigError>

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, ConfigError>

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 duplicate 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<'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 for ListenerBuilder

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

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 StructuralPartialEq for ListenerBuilder

Auto Trait Implementations§

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where T: 'a,

Source§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

Source§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where T: 'a,

Source§

fn implicit( self, class: Class, constructed: bool, tag: u32, ) -> TaggedParser<'a, Implicit, Self, E>

Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

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

Source§

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

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

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

Source§

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 T
where 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> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

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 T
where U: Into<T>,

Source§

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 T
where U: TryFrom<T>,

Source§

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.
Source§

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

Source§

fn vzip(self) -> V

Source§

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