Struct lemmy_utils::settings::structs::Settings[][src]

pub struct Settings {
Show 15 fields pub database: DatabaseConfig, pub rate_limit: Option<RateLimitConfig>, pub federation: FederationConfig, pub captcha: CaptchaConfig, pub email: Option<EmailConfig>, pub setup: Option<SetupConfig>, pub hostname: String, pub bind: IpAddr, pub port: u16, pub tls_enabled: bool, pub pictrs_url: Option<String>, pub additional_slurs: Option<String>, pub actor_name_max_length: usize, pub webfinger_community_regex: Option<Regex>, pub webfinger_username_regex: Option<Regex>,
}

Fields

database: DatabaseConfigrate_limit: Option<RateLimitConfig>federation: FederationConfigcaptcha: CaptchaConfigemail: Option<EmailConfig>setup: Option<SetupConfig>hostname: Stringbind: IpAddrport: u16tls_enabled: boolpictrs_url: Option<String>additional_slurs: Option<String>actor_name_max_length: usizewebfinger_community_regex: Option<Regex>webfinger_username_regex: Option<Regex>

Implementations

Reads config from configuration file.

Note: The env var LEMMY_DATABASE_URL is parsed in lemmy_db_queries/src/lib.rs::get_database_url_from_env() Warning: Only call this once.

Returns the config as a struct.

Returns either “http” or “https”, depending on tls_enabled setting

Returns something like http://localhost or https://lemmy.ml, with the correct protocol and hostname.

When running the federation test setup in api_tests/ or docker/federation, the hostname variable will be like lemmy-alpha:8541. This method removes the port and returns lemmy-alpha instead. It has no effect in production.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Return Settings { database: Default::default(), rate_limit: Some(RateLimitConfig :: default()), federation: FederationConfig :: default(), captcha: CaptchaConfig :: default(), email: None, setup: None, hostname: ("unset").into(), bind: IpAddr :: V4(Ipv4Addr :: new(0, 0, 0, 0)), port: 8536, tls_enabled: true, pictrs_url: None, additional_slurs: None, actor_name_max_length: 20, webfinger_community_regex: None, webfinger_username_regex: None }

Deserialize this value from the given Serde deserializer. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

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

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Performs the conversion.

Convert self to an expression for Diesel’s query builder. Read more

Convert &self to an expression for Diesel’s query builder. Read more

Should always be Self

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

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

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