pub struct Group {
pub user_agents: Vec<String>,
pub rules: Vec<Rule>,
pub crawl_delay: Option<f64>,
pub request_rate: Option<RequestRate>,
}Expand description
A group of rules for specific user-agents
Fields§
§user_agents: Vec<String>User-agent tokens this group applies to
rules: Vec<Rule>Rules in this group (in order)
crawl_delay: Option<f64>Crawl-delay directive (optional, in seconds)
request_rate: Option<RequestRate>Request-rate directive (optional, non-standard)
Implementations§
Source§impl Group
impl Group
Sourcepub fn matches_user_agent(&self, token: &str) -> bool
pub fn matches_user_agent(&self, token: &str) -> bool
Check if this group matches a user-agent token
Sourcepub fn is_wildcard(&self) -> bool
pub fn is_wildcard(&self) -> bool
Check if this is the wildcard group
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Group
impl<'de> Deserialize<'de> for Group
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
Auto Trait Implementations§
impl Freeze for Group
impl RefUnwindSafe for Group
impl Send for Group
impl Sync for Group
impl Unpin for Group
impl UnwindSafe for Group
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