fn build_url(&self,
                 instance: Instance,
                 path: Vec<String>,
                 query: Vec<(String, String)>) -> Url {
        Url {
            // bit before ://
            scheme: format!("{}", instance.scheme),
            // bit after :// before ?
            scheme_data: SchemeData::Relative(RelativeSchemeData {
                username: String::from_str(""),
                password: None,
                host: instance.host.clone(),
                port: Some(instance.port),
                default_port: Some(instance.port), // TODO what to do here?
                path: path
            }),
            // Bit after ? before #
            query: Some(::url::form_urlencoded::serialize_owned(query.as_slice())),
            // Bit after #
            fragment: None
        }
    }
/// Creates a url for a request
Creates a url for a request
Creates a url for a request
fn build_url(&self,
                 instance: Instance,
                 path: Vec<String>,
                 query: Vec<(String, String)>) -> Url {
        Url {
            // bit before ://
            scheme: format!("{}", instance.scheme),
            // bit after :// before ?
            scheme_data: SchemeData::Relative(RelativeSchemeData {
                username: String::from_str(""),
                password: None,
                host: instance.host.clone(),
                port: Some(instance.port),
                default_port: Some(instance.port), // TODO what to do here?
                path: path
            }),
            // Bit after ? before #
            query: Some(::url::form_urlencoded::serialize_owned(query.as_slice())),
            // Bit after #
            fragment: None
        }
    }
fn build_url ( & self , instance : Instance , path : Vec < String > , query : Vec < ( String , String ) > ) -> Url { Url { // bit before :// scheme : format ! ( " " instance scheme ) , // bit after :// before ? scheme_data : SchemeData :: Relative ( RelativeSchemeData { username : String :: from_str ( " " ) , password : None , host : instance . host . clone ( ) , port : Some ( instance . port ) , default_port : Some ( instance . port ) , // TODO what to do here? path : path } ) , // Bit after ? before # query : Some ( :: url :: form_urlencoded :: serialize_owned ( query . as_slice ( ) ) ) , // Bit after # fragment : None } }
Creates a url for a request
Creates a url for a request
&self
instance
Instance
path
Vec<String>
query
Vec<(String, String)>
&self
instance
Instance
path
Vec<String>
query
Vec<(String, String)>