Struct sozu_command_lib::config::ListenerBuilder
source · 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
impl ListenerBuilder
sourcepub fn new_http<S>(address: S) -> ListenerBuilderwhere
S: ToString,
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
sourcepub fn new_tcp<S>(address: S) -> ListenerBuilderwhere
S: ToString,
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
sourcepub fn new_https<S>(address: S) -> ListenerBuilderwhere
S: ToString,
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
pub fn with_public_address<S>(&mut self, public_address: Option<S>) -> &mut Selfwhere S: ToString,
pub fn with_answer_404_path<S>( &mut self, answer_404_path: Option<S> ) -> &mut Selfwhere S: ToString,
pub fn with_answer_503_path<S>( &mut self, answer_503_path: Option<S> ) -> &mut Selfwhere S: ToString,
pub fn with_tls_versions(&mut self, tls_versions: Vec<TlsVersion>) -> &mut Self
pub fn with_cipher_list( &mut self, cipher_list: Option<Vec<String>> ) -> &mut Self
pub fn with_cipher_suites( &mut self, cipher_suites: Option<Vec<String>> ) -> &mut Self
pub fn with_expect_proxy(&mut self, expect_proxy: bool) -> &mut Self
pub fn with_sticky_name<S>(&mut self, sticky_name: Option<S>) -> &mut Selfwhere S: ToString,
pub fn with_certificate<S>(&mut self, certificate: S) -> &mut Selfwhere S: ToString,
pub fn with_certificate_chain(&mut self, certificate_chain: String) -> &mut Self
pub fn with_key<S>(&mut self, key: String) -> &mut Selfwhere S: ToString,
pub fn with_front_timeout(&mut self, front_timeout: Option<u32>) -> &mut Self
pub fn with_back_timeout(&mut self, back_timeout: Option<u32>) -> &mut Self
pub fn with_connect_timeout( &mut self, connect_timeout: Option<u32> ) -> &mut Self
pub fn with_request_timeout( &mut self, request_timeout: Option<u32> ) -> &mut Self
pub fn parse_address(&self) -> Result<SocketAddr>
pub fn parse_public_address(&self) -> Result<Option<SocketAddr>>
sourcepub fn to_http(&mut self, config: Option<&Config>) -> Result<HttpListenerConfig>
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
Trait Implementations§
source§impl Clone for ListenerBuilder
impl Clone for ListenerBuilder
source§fn clone(&self) -> ListenerBuilder
fn clone(&self) -> ListenerBuilder
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for ListenerBuilder
impl Debug for ListenerBuilder
source§impl Default for ListenerBuilder
impl Default for ListenerBuilder
source§fn default() -> ListenerBuilder
fn default() -> ListenerBuilder
Returns the “default value” for a type. Read more
source§impl<'de> Deserialize<'de> for ListenerBuilder
impl<'de> Deserialize<'de> for ListenerBuilder
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
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
impl PartialEq<ListenerBuilder> for ListenerBuilder
source§fn eq(&self, other: &ListenerBuilder) -> bool
fn eq(&self, other: &ListenerBuilder) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl Serialize for ListenerBuilder
impl Serialize for ListenerBuilder
impl Eq for ListenerBuilder
impl StructuralEq for ListenerBuilder
impl StructuralPartialEq for ListenerBuilder
Auto Trait Implementations§
impl RefUnwindSafe for ListenerBuilder
impl Send for ListenerBuilder
impl Sync for ListenerBuilder
impl Unpin for ListenerBuilder
impl UnwindSafe for ListenerBuilder
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
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,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
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,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.