pub struct Settings {
pub sources: Vec<RawSource>,
pub ignored_urls: Vec<String>,
pub underlying_urls: Vec<String>,
pub cache_mode: CacheMode,
pub max_concurrent_requests: usize,
pub request_timeout: u64,
pub request_throttling: u64,
pub max_idle_connections_per_host: usize,
pub idle_connections_timeout: u64,
}
Expand description
Describes the settings used in Bogrep.
Fields§
§sources: Vec<RawSource>
The paths to the configured bookmark files.
Source could be Firefox or Chrome.
ignored_urls: Vec<String>
The urls which are ignored and not imported.
underlying_urls: Vec<String>
Fetch the underlying for the given urls.
cache_mode: CacheMode
The file extension used to cache websites.
max_concurrent_requests: usize
The maximal number of concurrent requests.
request_timeout: u64
The request timeout in milliseconds.
request_throttling: u64
The throttling between requests in milliseconds.
max_idle_connections_per_host: usize
The maximum number of idle connections allowed in the connection pool.
idle_connections_timeout: u64
The timeout for idle connections to be kept alive in milliseconds.
Implementations§
source§impl Settings
impl Settings
pub fn new( sources: Vec<RawSource>, ignored_urls: Vec<String>, underlying_urls: Vec<String>, cache_mode: CacheMode, max_concurrent_requests: usize, request_timeout: u64, request_throttling: u64, max_idle_connections_per_host: usize, idle_connections_timeout: u64 ) -> Self
pub fn init(settings_path: &Path) -> Result<Settings, Error>
pub fn add_ignored_url(&mut self, url: &str) -> Result<(), Error>
pub fn add_underlying_url(&mut self, url: &str) -> Result<(), Error>
pub fn set_source(&mut self, source: RawSource) -> Result<(), Error>
pub fn set_cache_mode(&mut self, cache_mode: Option<CacheMode>)
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>,
Deserialize this value from the given Serde deserializer. Read more
source§impl PartialEq for Settings
impl PartialEq for Settings
impl StructuralPartialEq for Settings
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