Struct autoendpoint::settings::Settings

source ·
pub struct Settings {
Show 21 fields pub scheme: String, pub host: String, pub port: u16, pub endpoint_url: String, pub db_dsn: Option<String>, pub db_settings: String, pub router_table_name: String, pub message_table_name: String, pub tracking_keys: String, pub max_data_bytes: usize, pub crypto_keys: String, pub auth_keys: String, pub human_logs: bool, pub connection_timeout_millis: u64, pub request_timeout_millis: u64, pub statsd_host: Option<String>, pub statsd_port: u16, pub statsd_label: String, pub fcm: FcmSettings, pub apns: ApnsSettings, pub stub: StubSettings,
}

Fields§

§scheme: String§host: String§port: u16§endpoint_url: String§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)

§router_table_name: String§message_table_name: String§tracking_keys: String

A stringified JSON list of VAPID public keys which should be tracked internally. This should ONLY include Mozilla generated and consumed messages (e.g. “SendToTab”, etc.) These keys should be specified in stripped, b64encoded, X962 format (e.g. a single line of base64 encoded data without padding). You can use scripts/convert_pem_to_x962.py to easily convert EC Public keys stored in PEM format into appropriate x962 format.

§max_data_bytes: usize§crypto_keys: String§auth_keys: String§human_logs: bool§connection_timeout_millis: u64§request_timeout_millis: u64§statsd_host: Option<String>§statsd_port: u16§statsd_label: String§fcm: FcmSettings§apns: ApnsSettings§stub: StubSettings

Implementations§

source§

impl Settings

source

pub fn with_env_and_config_file( filename: &Option<String>, ) -> Result<Self, ConfigError>

Load the settings from the config file if supplied, then the environment.

source

fn read_list_from_str<'list>( list_str: &'list str, panic_msg: &'static str, ) -> impl Iterator<Item = &'list str>

Convert a string like [item1,item2] into a iterator over item1 and item2. Panics with a custom message if the string is not in the expected form.

source

pub fn make_fernet(&self) -> MultiFernet

Initialize the fernet encryption instance

source

pub fn auth_keys(&self) -> Vec<String>

Get the list of auth hash keys

source

pub fn tracking_keys(&self) -> Vec<String>

Get the list of tracking public keys

source

pub fn endpoint_url(&self) -> Url

Get the URL for this endpoint server

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() -> Settings

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 + Send + Sync>

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§

default 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> IntoEither for T

source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where 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 T
where 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 T
where 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 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,