pub fn matches(&self, request_url: &Url) -> Vec<&Cookie<'static>> {
        // although we domain_match and path_match as we descend through the tree, we
        // still need to
        // do a full Cookie::matches() check in the last filter. Otherwise, we cannot
        // properly deal
        // with HostOnly Cookies.
        let cookies = self
            .cookies
            .iter()
            .filter(|&(d, _)| domain_match(d, request_url))
            .flat_map(|(_, dcs)| {
                dcs.iter()
                    .filter(|&(p, _)| path_match(p, request_url))
                    .flat_map(|(_, pcs)| {
                        pcs.values()
                            .filter(|c| !c.is_expired() && c.matches(request_url))
                    })
            });
        match (!is_http_scheme(request_url), !is_secure(request_url)) {
            (true, true) => cookies
                .filter(|c| !c.http_only().unwrap_or(false) && !c.secure().unwrap_or(false))
                .collect(),
            (true, false) => cookies
                .filter(|c| !c.http_only().unwrap_or(false))
                .collect(),
            (false, true) => cookies.filter(|c| !c.secure().unwrap_or(false)).collect(),
            (false, false) => cookies.collect(),
        }
    }
/// Returns a collection of references to __unexpired__ cookies that path- and domain-match
/// `request_url`, as well as having HttpOnly and Secure attributes compatible with the
/// `request_url`.
Returns a collection of references to __unexpired__ cookies that path- and domain-match
`request_url`, as well as having HttpOnly and Secure attributes compatible with the
`request_url`.
Returns a collection of references to __unexpired__ cookies that path - and domain - match ` request_url ` as well as having HttpOnly and Secure attributes compatible with the ` request_url ` .
pub fn matches(&self, request_url: &Url) -> Vec<&Cookie<'static>> {
        // although we domain_match and path_match as we descend through the tree, we
        // still need to
        // do a full Cookie::matches() check in the last filter. Otherwise, we cannot
        // properly deal
        // with HostOnly Cookies.
        let cookies = self
            .cookies
            .iter()
            .filter(|&(d, _)| domain_match(d, request_url))
            .flat_map(|(_, dcs)| {
                dcs.iter()
                    .filter(|&(p, _)| path_match(p, request_url))
                    .flat_map(|(_, pcs)| {
                        pcs.values()
                            .filter(|c| !c.is_expired() && c.matches(request_url))
                    })
            });
        match (!is_http_scheme(request_url), !is_secure(request_url)) {
            (true, true) => cookies
                .filter(|c| !c.http_only().unwrap_or(false) && !c.secure().unwrap_or(false))
                .collect(),
            (true, false) => cookies
                .filter(|c| !c.http_only().unwrap_or(false))
                .collect(),
            (false, true) => cookies.filter(|c| !c.secure().unwrap_or(false)).collect(),
            (false, false) => cookies.collect(),
        }
    }
pub fn matches ( & self , request_url : & Url ) -> Vec < & Cookie < ' static > > { // although we domain_match and path_match as we descend through the tree, we // still need to // do a full Cookie::matches() check in the last filter. Otherwise, we cannot // properly deal // with HostOnly Cookies. let cookies = self . cookies . iter ( ) . filter ( | & ( d , _ ) | domain_match ( d , request_url ) ) . flat_map ( | ( _ , dcs ) | { dcs . iter ( ) . filter ( | & ( p , _ ) | path_match ( p , request_url ) ) . flat_map ( | ( _ , pcs ) | { pcs . values ( ) . filter ( | c | ! c . is_expired ( ) && c . matches ( request_url ) ) } ) } ) ; match ( ! is_http_scheme ( request_url ) , ! is_secure ( request_url ) ) { ( true , true ) => cookies . filter ( | c | ! c . http_only ( ) . unwrap_or ( false ) && ! c . secure ( ) . unwrap_or ( false ) ) . collect ( ) , ( true , false ) => cookies . filter ( | c | ! c . http_only ( ) . unwrap_or ( false ) ) . collect ( ) , ( false , true ) => cookies . filter ( | c | ! c . secure ( ) . unwrap_or ( false ) ) . collect ( ) , ( false , false ) => cookies . collect ( ) , } }
Returns a collection of references to __unexpired__ cookies that path- and domain-match
`request_url`, as well as having HttpOnly and Secure attributes compatible with the
`request_url`.
Returns a collection of references to __unexpired__ cookies that path - and domain - match ` request_url ` as well as having HttpOnly and Secure attributes compatible with the ` request_url ` .
&self
request_url
&Url