/// Creates a new Link.
/// Does not assume any argument.
Creates a new Link.
Does not assume any argument.
Creates a new Link . Does not assume any argument .
pub fn new(
        url: &Url,
        headers: &Option<reqwest::header::HeaderMap>,
        ipv4: Option<Ipv4Addr>,
        ipv6: Option<Ipv6Addr>,
        crawled: bool,
        link_type: LinkType,
        contains_words: bool,
    ) -> Self {
        let host = match url.host() {
            Some(x) => Some(x.to_owned()),
            None => None,
        };
        let content_type = match headers {
            Some(x) => Self::get_mime(x),
            None => None,
        };
        Link {
            url: url.to_owned(),
            headers: headers.to_owned(),
            content_type,
            host,
            ipv4,
            ipv6,
            crawled,
            link_type,
            contains_words,
        }
    }
pub fn new ( url : & Url , headers : & Option < reqwest :: header :: HeaderMap > , ipv4 : Option < Ipv4Addr > , ipv6 : Option < Ipv6Addr > , crawled : bool , link_type : LinkType , contains_words : bool , ) -> Self { let host = match url . host ( ) { Some ( x ) => Some ( x . to_owned ( ) ) , None => None , } ; let content_type = match headers { Some ( x ) => Self :: get_mime ( x ) , None => None , } ; Link { url : url . to_owned ( ) , headers : headers . to_owned ( ) , content_type , host , ipv4 , ipv6 , crawled , link_type , contains_words , } }
Creates a new Link.
Creates a new Link .
url
&Url
headers
&Option<reqwest::header::HeaderMap>
ipv4
Option<Ipv4Addr>
ipv6
Option<Ipv6Addr>
crawled
bool
link_type
LinkType
contains_words
bool