pub struct Settings {Show 84 fields
pub pref_path: String,
pub default_ext_config: String,
pub exclude_remarks: Vec<String>,
pub include_remarks: Vec<String>,
pub custom_rulesets: Vec<RulesetConfig>,
pub custom_proxy_groups: Vec<ProxyGroupConfig>,
pub rulesets_content: Vec<RulesetContent>,
pub stream_rules: Vec<RegexMatchConfig>,
pub time_rules: Vec<RegexMatchConfig>,
pub renames: RegexMatchConfigs,
pub emojis: RegexMatchConfigs,
pub default_urls: Vec<String>,
pub insert_urls: Vec<String>,
pub managed_config_prefix: String,
pub max_pending_conns: u32,
pub max_concur_threads: u32,
pub prepend_insert: bool,
pub skip_failed_links: bool,
pub api_mode: bool,
pub write_managed_config: bool,
pub enable_rule_gen: bool,
pub update_ruleset_on_request: bool,
pub overwrite_original_rules: bool,
pub append_userinfo: bool,
pub async_fetch_ruleset: bool,
pub surge_resolve_hostname: bool,
pub api_access_token: String,
pub base_path: String,
pub custom_group: String,
pub log_level: u32,
pub max_allowed_download_size: i64,
pub template_path: String,
pub template_vars: HashMap<String, String>,
pub prepend_proxy_direct_ruleset: bool,
pub aliases: HashMap<String, String>,
pub generator_mode: bool,
pub generate_profiles: String,
pub reload_conf_on_request: bool,
pub add_emoji: bool,
pub remove_emoji: bool,
pub append_type: bool,
pub filter_deprecated: bool,
pub udp_flag: Option<bool>,
pub tfo_flag: Option<bool>,
pub skip_cert_verify: Option<bool>,
pub tls13_flag: Option<bool>,
pub enable_insert: bool,
pub enable_sort: bool,
pub update_strict: bool,
pub clash_use_new_field: bool,
pub singbox_add_clash_modes: bool,
pub clash_proxies_style: String,
pub clash_proxy_groups_style: String,
pub proxy_config: String,
pub proxy_ruleset: String,
pub proxy_subscription: String,
pub update_interval: u32,
pub sort_script: String,
pub filter_script: String,
pub enable_filter: bool,
pub clash_base: String,
pub surge_base: String,
pub surfboard_base: String,
pub mellow_base: String,
pub quan_base: String,
pub quanx_base: String,
pub loon_base: String,
pub ssub_base: String,
pub singbox_base: String,
pub surge_ssr_path: String,
pub quanx_dev_id: String,
pub serve_cache_on_fetch_fail: bool,
pub cache_subscription: u32,
pub cache_config: u32,
pub cache_ruleset: u32,
pub listen_address: String,
pub listen_port: u32,
pub serve_file: bool,
pub serve_file_root: String,
pub max_allowed_rulesets: usize,
pub max_allowed_rules: usize,
pub script_clean_context: bool,
pub enable_cron: bool,
pub cron_tasks: CronTaskConfigs,
}Expand description
Settings structure to hold global configuration
Fields§
§pref_path: String§default_ext_config: String§exclude_remarks: Vec<String>§include_remarks: Vec<String>§custom_rulesets: Vec<RulesetConfig>§custom_proxy_groups: Vec<ProxyGroupConfig>§rulesets_content: Vec<RulesetContent>§stream_rules: Vec<RegexMatchConfig>§time_rules: Vec<RegexMatchConfig>§renames: RegexMatchConfigs§emojis: RegexMatchConfigs§default_urls: Vec<String>§insert_urls: Vec<String>§managed_config_prefix: String§max_pending_conns: u32§max_concur_threads: u32§prepend_insert: bool§skip_failed_links: bool§api_mode: bool§write_managed_config: bool§enable_rule_gen: bool§update_ruleset_on_request: bool§overwrite_original_rules: bool§append_userinfo: bool§async_fetch_ruleset: bool§surge_resolve_hostname: bool§api_access_token: String§base_path: String§custom_group: String§log_level: u32§max_allowed_download_size: i64§template_path: String§template_vars: HashMap<String, String>Template variables used for template rendering
prepend_proxy_direct_ruleset: bool§aliases: HashMap<String, String>§generator_mode: bool§generate_profiles: String§reload_conf_on_request: bool§add_emoji: bool§remove_emoji: bool§append_type: bool§filter_deprecated: bool§udp_flag: Option<bool>§tfo_flag: Option<bool>§skip_cert_verify: Option<bool>§tls13_flag: Option<bool>§enable_insert: bool§enable_sort: bool§update_strict: bool§clash_use_new_field: bool§singbox_add_clash_modes: bool§clash_proxies_style: String§clash_proxy_groups_style: String§proxy_config: String§proxy_ruleset: String§proxy_subscription: String§update_interval: u32§sort_script: String§filter_script: String§enable_filter: bool§clash_base: String§surge_base: String§surfboard_base: String§mellow_base: String§quan_base: String§quanx_base: String§loon_base: String§ssub_base: String§singbox_base: String§surge_ssr_path: String§quanx_dev_id: String§serve_cache_on_fetch_fail: bool§cache_subscription: u32§cache_config: u32§cache_ruleset: u32§listen_address: String§listen_port: u32§serve_file: bool§serve_file_root: String§max_allowed_rulesets: usize§max_allowed_rules: usize§script_clean_context: bool§enable_cron: bool§cron_tasks: CronTaskConfigsImplementations§
Source§impl Settings
impl Settings
Sourcepub fn current_mut() -> RwLockWriteGuard<'static, Arc<Settings>>
pub fn current_mut() -> RwLockWriteGuard<'static, Arc<Settings>>
Get a mutable reference to the current settings
Sourcepub fn current() -> RwLockReadGuard<'static, Arc<Settings>>
pub fn current() -> RwLockReadGuard<'static, Arc<Settings>>
Get a read-only reference to the current settings
pub async fn load_from_content( content: &str, file_path: &str, ) -> Result<Self, Box<dyn Error>>
Trait Implementations§
Source§impl From<IniSettings> for Settings
impl From<IniSettings> for Settings
Source§fn from(ini_settings: IniSettings) -> Self
fn from(ini_settings: IniSettings) -> Self
Converts to this type from the input type.
Source§impl From<TomlSettings> for Settings
impl From<TomlSettings> for Settings
Source§fn from(toml_settings: TomlSettings) -> Self
fn from(toml_settings: TomlSettings) -> Self
Converts to this type from the input type.
Source§impl From<YamlSettings> for Settings
impl From<YamlSettings> for Settings
Source§fn from(yaml_settings: YamlSettings) -> Self
fn from(yaml_settings: YamlSettings) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for Settings
impl RefUnwindSafe for Settings
impl Send for Settings
impl Sync for Settings
impl Unpin for Settings
impl UnwindSafe for Settings
Blanket Implementations§
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
Mutably borrows from an owned value. Read more