/// Creates a new Link if realtive url is supplied.
/// Need the relative url and the base url.
Creates a new Link if realtive url is supplied.
Need the relative url and the base url.
Creates a new Link if realtive url is supplied . Need the relative url and the base url .
pub fn new_relative(url: &str, base_url: &str) -> Option<Self> {
        let base_url_parsed = match Url::parse(base_url) {
            Ok(x) => x,
            Err(_) => return None,
        };
        match base_url_parsed.join(url) {
            Ok(x) => Self::new_from_str(x.as_str()),
            Err(_) => None,
        }
    }
pub fn new_relative ( url : & str , base_url : & str ) -> Option < Self > { let base_url_parsed = match Url :: parse ( base_url ) { Ok ( x ) => x , Err ( _ ) => return None , } ; match base_url_parsed . join ( url ) { Ok ( x ) => Self :: new_from_str ( x . as_str ( ) ) , Err ( _ ) => None , } }
Creates a new Link if realtive url is supplied.
Creates a new Link if realtive url is supplied .
url
&str
base_url
&str