pub fn can_fetch(&self, agent: &str, path: &str) -> bool {
        let url = Url::parse(path);
        match url {
            Ok(url) => {
                let path = percent_decode(url.path().as_bytes()).decode_utf8().unwrap();
                for rule in &*self.rules {
                    if rule.is_applicable(agent, &path) {
                        return rule.is_allowed(&path);
                    }
                }
                false
            }
            Err(_) => return false,
        }
    }
/// Decides if a path can be fetched by an agent
Decides if a path can be fetched by an agent
Decides if a path can be fetched by an agent
pub fn can_fetch(&self, agent: &str, path: &str) -> bool {
        let url = Url::parse(path);
        match url {
            Ok(url) => {
                let path = percent_decode(url.path().as_bytes()).decode_utf8().unwrap();
                for rule in &*self.rules {
                    if rule.is_applicable(agent, &path) {
                        return rule.is_allowed(&path);
                    }
                }
                false
            }
            Err(_) => return false,
        }
    }
pub fn can_fetch ( & self , agent : & str , path : & str ) -> bool { let url = Url :: parse ( path ) ; match url { Ok ( url ) => { let path = percent_decode ( url . path ( ) . as_bytes ( ) ) . decode_utf8 ( ) . unwrap ( ) ; for rule in & * self . rules { if rule . is_applicable ( agent , & path ) { return rule . is_allowed ( & path ) ; } } false } Err ( _ ) => return false , } }
Decides if a path can be fetched by an agent
Decides if a path can be fetched by an agent
&self
agent
&str
path
&str