pub struct Settings {Show 30 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 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 disable_sentry: bool,
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 client_channel_capacity: usize,
pub actix_max_connections: Option<usize>,
pub actix_workers: Option<usize>,
pub pool_max_idle_per_host: usize,
pub pool_idle_timeout_secs: u64,
pub reliability_dsn: Option<String>,
pub reliability_retry_count: 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: u16The application port to listen on
hostname: Option<String>The DNS specified name of the application host to used for internal routing
resolve_hostname: boolThe override hostname to use for internal routing (NOTE: requires hostname to be set)
router_port: u16The internal webpush routing port
router_hostname: Option<String>The DNS name to use for internal routing
auto_ping_interval: DurationThe server based ping interval (also used for Broadcast sends)
auto_ping_timeout: DurationHow long to wait for a response Pong before being timed out and connection drop
open_handshake_timeout: DurationHow long to wait for the initial connection handshake.
endpoint_scheme: StringThe URL scheme (http/https) for the endpoint URL
endpoint_hostname: StringThe host url for the endpoint URL (differs from hostname and resolve_hostname)
endpoint_port: u16The optional port override for the endpoint URL
crypto_key: StringThe seed key to use for endpoint encryption
statsd_host: Option<String>The host name to send recorded metrics
statsd_port: u16The port number to send recorded metrics
statsd_label: StringThe root label to apply to metrics.
disable_sentry: boolWhether to disable Sentry error reporting
db_dsn: Option<String>The DSN to connect to the storage engine (Used to select between storage systems)
db_settings: StringJSON 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 (deprecated, no longer used)
megaphone_poll_interval: DurationHow often to poll the server for new data
human_logs: boolUse human readable (simplified, non-JSON)
msg_limit: u32Maximum allowed number of backlogged messages. Exceeding this number will trigger a user reset because the user may have been offline way too long.
client_channel_capacity: usizeMaximum number of buffered notifications per client before backpressure is applied on the notification channel.
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.
pool_max_idle_per_host: usizeMaximum idle connections per host in the HTTP connection pool.
pool_idle_timeout_secs: u64Idle connection timeout in seconds.
reliability_dsn: Option<String>The DNS for the reliability data store. This is normally a Redis compatible storage system. See Connection Parameters for details.
reliability_retry_count: usizeMax number of retries for retries for Redis transactions
Implementations§
Source§impl Settings
impl Settings
Sourcepub fn with_env_and_config_files(
filenames: &[String],
) -> Result<Self, ConfigError>
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.
pub fn router_url(&self) -> String
pub fn endpoint_url(&self) -> String
pub fn validate(&self) -> Result<(), ConfigError>
pub fn test_settings() -> Self
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Settings
impl<'de> Deserialize<'de> for Settings
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>,
Auto Trait Implementations§
impl Freeze for Settings
impl RefUnwindSafe for Settings
impl Send for Settings
impl Sync for Settings
impl Unpin for Settings
impl UnsafeUnpin for Settings
impl UnwindSafe for Settings
Blanket Implementations§
§impl<T> AnySync for T
impl<T> AnySync for T
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more