pub struct Config {
pub base_url: String,
pub password: Option<String>,
pub timeout: Duration,
pub retries: u32,
pub tls_settings: Option<TlsSettings>,
pub proxy_config: Option<ProxyConfig>,
pub zstd: bool,
pub encryption_key: Option<String>,
}Expand description
Configuration for Rspamd client
Implements Clone, Eq and Hash, so it can be used directly as a key
in caches of persistent clients (e.g. an LRU of RspamdAsyncClient).
Fields§
§base_url: StringBase URL of Rspamd server
password: Option<String>Optional API key for authentication
timeout: DurationTimeout duration for requests
retries: u32Number of retries for requests
tls_settings: Option<TlsSettings>Custom TLS settings for the asynchronous client
proxy_config: Option<ProxyConfig>Proxy configuration for the asynchronous client
zstd: boolUse zstd compression
encryption_key: Option<String>Encryption key if using native HTTPCrypt encryption (must be in Rspamd base32 format)
Implementations§
Source§impl Config
impl Config
Sourcepub fn builder() -> ConfigBuilder<((), (), (), (), (), (), (), ())>
pub fn builder() -> ConfigBuilder<((), (), (), (), (), (), (), ())>
Create a builder for building Config.
On the builder, call .base_url(...), .password(...)(optional), .timeout(...)(optional), .retries(...)(optional), .tls_settings(...)(optional), .proxy_config(...)(optional), .zstd(...)(optional), .encryption_key(...)(optional) to set the values of the fields.
Finally, call .build() to create the instance of Config.
Trait Implementations§
impl Eq for Config
impl StructuralPartialEq for Config
Auto Trait Implementations§
impl Freeze for Config
impl RefUnwindSafe for Config
impl Send for Config
impl Sync for Config
impl Unpin for Config
impl UnsafeUnpin for Config
impl UnwindSafe for Config
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.