pub struct Config {
Show 30 fields pub config_path: String, pub command_socket: String, pub command_buffer_size: usize, pub max_command_buffer_size: usize, pub max_connections: usize, pub min_buffers: usize, pub max_buffers: usize, pub buffer_size: usize, pub saved_state: Option<String>, pub automatic_state_save: bool, pub log_level: String, pub log_target: String, pub log_access_target: Option<String>, pub worker_count: u16, pub worker_automatic_restart: bool, pub metrics: Option<MetricsConfig>, pub http_listeners: Vec<HttpListenerConfig>, pub https_listeners: Vec<HttpsListenerConfig>, pub tcp_listeners: Vec<TcpListenerConfig>, pub clusters: HashMap<String, ClusterConfig>, pub handle_process_affinity: bool, pub ctl_command_timeout: u64, pub pid_file_path: Option<String>, pub activate_listeners: bool, pub front_timeout: u32, pub back_timeout: u32, pub connect_timeout: u32, pub zombie_check_interval: u32, pub accept_queue_timeout: u32, pub request_timeout: u32,
}
Expand description

Sōzu configuration, populated with clusters and listeners.

This struct is used on startup to generate WorkerRequests

Fields§

§config_path: String§command_socket: String§command_buffer_size: usize§max_command_buffer_size: usize§max_connections: usize§min_buffers: usize§max_buffers: usize§buffer_size: usize§saved_state: Option<String>§automatic_state_save: bool§log_level: String§log_target: String§log_access_target: Option<String>§worker_count: u16§worker_automatic_restart: bool§metrics: Option<MetricsConfig>§http_listeners: Vec<HttpListenerConfig>§https_listeners: Vec<HttpsListenerConfig>§tcp_listeners: Vec<TcpListenerConfig>§clusters: HashMap<String, ClusterConfig>§handle_process_affinity: bool§ctl_command_timeout: u64§pid_file_path: Option<String>§activate_listeners: bool§front_timeout: u32§back_timeout: u32§connect_timeout: u32§zombie_check_interval: u32§accept_queue_timeout: u32§request_timeout: u32

Implementations§

source§

impl Config

source

pub fn load_from_path(path: &str) -> Result<Config>

Parse a TOML file and build a config out of it

source

pub fn generate_config_messages(&self) -> Result<Vec<WorkerRequest>>

yields requests intended to recreate a proxy that match the config

source

pub fn command_socket_path(&self) -> Result<String>

Get the path of the UNIX socket used to communicate with Sōzu

source

pub fn load_file(path: &str) -> Result<String>

read any file to a string

source

pub fn load_file_bytes(path: &str) -> Result<Vec<u8>>

read any file to bytes

Trait Implementations§

source§

impl Clone for Config

source§

fn clone(&self) -> Config

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 Config

source§

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

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

impl Default for Config

source§

fn default() -> Config

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

impl<'de> Deserialize<'de> for Config

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<Config> for Config

source§

fn eq(&self, other: &Config) -> 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 Config

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 Config

source§

impl StructuralEq for Config

source§

impl StructuralPartialEq for Config

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