pub fn matches(&self, request_url: &Url) -> bool {
        if let Some(url_host) = request_url.host_str() {
            match *self {
                CookieDomain::HostOnly(ref host) => host == url_host,
                CookieDomain::Suffix(ref suffix) => {
                    suffix == url_host
                        || (is_host_name(url_host)
                            && url_host.ends_with(suffix)
                            && url_host[(url_host.len() - suffix.len() - 1)..].starts_with('.'))
                }
                CookieDomain::NotPresent | CookieDomain::Empty => false, // nothing can match the Empty case
            }
        } else {
            false // not a matchable scheme
        }
    }
/// Tests if the given `url::Url` meets the domain-match criteria
Tests if the given `url::Url` meets the domain-match criteria
Tests if the given ` url :: Url ` meets the domain - match criteria
pub fn matches(&self, request_url: &Url) -> bool {
        if let Some(url_host) = request_url.host_str() {
            match *self {
                CookieDomain::HostOnly(ref host) => host == url_host,
                CookieDomain::Suffix(ref suffix) => {
                    suffix == url_host
                        || (is_host_name(url_host)
                            && url_host.ends_with(suffix)
                            && url_host[(url_host.len() - suffix.len() - 1)..].starts_with('.'))
                }
                CookieDomain::NotPresent | CookieDomain::Empty => false, // nothing can match the Empty case
            }
        } else {
            false // not a matchable scheme
        }
    }
pub fn matches ( & self , request_url : & Url ) -> bool { if let Some ( url_host ) = request_url . host_str ( ) { match * self { CookieDomain :: HostOnly ( ref host ) => host == url_host , CookieDomain :: Suffix ( ref suffix ) => { suffix == url_host || ( is_host_name ( url_host ) && url_host . ends_with ( suffix ) && url_host [ ( url_host . len ( ) - suffix . len ( ) - 1 ) .. ] . starts_with ( '.' ) ) } CookieDomain :: NotPresent | CookieDomain :: Empty => false , // nothing can match the Empty case } } else { false // not a matchable scheme } }
Tests if the given `url::Url` meets the domain-match criteria
Tests if the given ` url :: Url ` meets the domain - match criteria
&self
request_url
&Url