pub struct Config { /* private fields */ }Expand description
A validation configuration.
Implementations§
Source§impl Config
impl Config
Sourcepub fn new(
roots: Vec<String>,
default: Arc<SiteConfig>,
sites: HashMap<String, HashMap<String, Arc<SiteConfig>>>,
) -> Self
pub fn new( roots: Vec<String>, default: Arc<SiteConfig>, sites: HashMap<String, HashMap<String, Arc<SiteConfig>>>, ) -> Self
Creates a configuration.
Sourcepub fn ignored_links(&self) -> impl Iterator<Item = &Regex>
pub fn ignored_links(&self) -> impl Iterator<Item = &Regex>
Returns ignored link patterns.
Sourcepub const fn sites(&self) -> &HashMap<String, Vec<(String, Arc<SiteConfig>)>>
pub const fn sites(&self) -> &HashMap<String, Vec<(String, Arc<SiteConfig>)>>
Returns websites.
Sourcepub fn site(&self, url: &Url) -> &SiteConfig
pub fn site(&self, url: &Url) -> &SiteConfig
Gets a site config
Sourcepub const fn concurrency(&self) -> &ConcurrencyConfig
pub const fn concurrency(&self) -> &ConcurrencyConfig
Returns concurrency.
Sourcepub const fn persistent_cache(&self) -> bool
pub const fn persistent_cache(&self) -> bool
Returns whether a cache is persistent.
Sourcepub const fn rate_limit(&self) -> &RateLimitConfig
pub const fn rate_limit(&self) -> &RateLimitConfig
Returns a rate limit.
Sourcepub fn set_concurrency(self, concurrency: ConcurrencyConfig) -> Self
pub fn set_concurrency(self, concurrency: ConcurrencyConfig) -> Self
Sets concurrency.
Sourcepub fn set_ignored_links(self, links: Vec<Regex>) -> Self
pub fn set_ignored_links(self, links: Vec<Regex>) -> Self
Sets ignored link patterns.
Sourcepub const fn set_persistent_cache(self, persistent_cache: bool) -> Self
pub const fn set_persistent_cache(self, persistent_cache: bool) -> Self
Sets persistent cache.
Sourcepub fn set_rate_limit(self, rate_limit: RateLimitConfig) -> Self
pub fn set_rate_limit(self, rate_limit: RateLimitConfig) -> Self
Sets a rate limit.
Trait Implementations§
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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