Struct autoconnect_settings::Settings

source ·
pub struct Settings {
Show 25 fields pub port: u16, pub hostname: Option<String>, pub resolve_hostname: bool, pub router_port: u16, pub router_hostname: Option<String>, pub auto_ping_interval: Duration, pub auto_ping_timeout: Duration, pub open_handshake_timeout: Duration, pub close_handshake_timeout: Duration, pub endpoint_scheme: String, pub endpoint_hostname: String, pub endpoint_port: u16, pub crypto_key: String, pub statsd_host: Option<String>, pub statsd_port: u16, pub statsd_label: String, pub db_dsn: Option<String>, pub db_settings: String, pub megaphone_api_url: Option<String>, pub megaphone_api_token: Option<String>, pub megaphone_poll_interval: Duration, pub human_logs: bool, pub msg_limit: u32, pub actix_max_connections: Option<usize>, pub actix_workers: Option<usize>,
}
Expand description

The Applications settings, read from CLI, Environment or settings file, for the autoconnect application. These are later converted to [autoconnect::autoconnect-settings::AppState].

Fields§

§port: u16

The application port to listen on

§hostname: Option<String>

The DNS specified name of the application host to used for internal routing

§resolve_hostname: bool

The override hostname to use for internal routing (NOTE: requires hostname to be set)

§router_port: u16

The internal webpush routing port

§router_hostname: Option<String>

The DNS name to use for internal routing

§auto_ping_interval: Duration

The server based ping interval (also used for Broadcast sends)

§auto_ping_timeout: Duration

How long to wait for a response Pong before being timed out and connection drop

§open_handshake_timeout: Duration

How long to wait for the initial connection handshake.

§close_handshake_timeout: Duration

How long to wait while closing a connection for the response handshake.

§endpoint_scheme: String

The URL scheme (http/https) for the endpoint URL

§endpoint_hostname: String

The host url for the endpoint URL (differs from hostname and resolve_hostname)

§endpoint_port: u16

The optional port override for the endpoint URL

§crypto_key: String

The seed key to use for endpoint encryption

§statsd_host: Option<String>

The host name to send recorded metrics

§statsd_port: u16

The port number to send recorded metrics

§statsd_label: String

The root label to apply to metrics.

§db_dsn: Option<String>

The DSN to connect to the storage engine (Used to select between storage systems)

§db_settings: String

JSON set of specific database settings (See data storage engines)

§megaphone_api_url: Option<String>

Server endpoint to pull Broadcast ID change values (Sent in Pings)

§megaphone_api_token: Option<String>

Broadcast token for authentication

§megaphone_poll_interval: Duration

How often to poll the server for new data

§human_logs: bool

Use human readable (simplified, non-JSON)

§msg_limit: u32

Maximum allowed number of backlogged messages. Exceeding this number will trigger a user reset because the user may have been offline way too long.

§actix_max_connections: Option<usize>

Sets the maximum number of concurrent connections per actix-web worker.

All socket listeners will stop accepting connections when this limit is reached for each worker.

§actix_workers: Option<usize>

Sets number of actix-web workers to start (per bind address).

By default, the number of available physical CPUs is used as the worker count.

Implementations§

source§

impl Settings

source

pub fn with_env_and_config_files( filenames: &[String], ) -> Result<Self, ConfigError>

Load the settings from the config files in order first then the environment.

source

pub fn router_url(&self) -> String

source

pub fn endpoint_url(&self) -> String

source

pub fn validate(&self) -> Result<(), ConfigError>

source

pub fn test_settings() -> Self

Trait Implementations§

source§

impl Clone for Settings

source§

fn clone(&self) -> Settings

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 Settings

source§

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

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

impl Default for Settings

source§

fn default() -> Self

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

impl<'de> Deserialize<'de> for Settings

source§

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

Deserialize this value from the given Serde deserializer. Read more

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
§

impl<T> Any for T
where T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

§

fn type_name(&self) -> &'static str

§

impl<T> AnySync for T
where T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

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, dst: *mut T)

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

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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.
§

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

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
source§

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

§

impl<T> SendSyncUnwindSafe for T
where T: Send + Sync + UnwindSafe + ?Sized,