fn request(&mut self,
                     method: Method,
                     path: Vec<String>,
                     query: Option<Vec<(String, String)>>) -> Arc<RwLock<RequestStatus<(), ()>>> {
        // TODO handle no hosts more gracefully
        let instance = self.get_instance().expect("No hosts left");
        let mut query = match query {
            Some(vec) => {
                let mut vec = vec.clone();
                vec.reserve(2);
                vec
            },
            None => {Vec::with_capacity(2)}
        };
        query.push((String::from_str("u"), self.username.clone()));
        query.push((String::from_str("p"), self.password.clone()));
        let url = self.build_url(instance, path, query);
        let mut builder = self.hyper_client.request(method, url);
        let response = Arc::new(RwLock::new(RequestStatus::new()));
        let moved_response = response.clone();

        Thread::spawn(move || {
             
        });
        response
    }
/// Builds a request and sends it - returning the request status, which can be
/// queried like a future
Builds a request and sends it - returning the request status, which can be
queried like a future
Builds a request and sends it - returning the request status which can be queried like a future
fn request(&mut self,
                     method: Method,
                     path: Vec<String>,
                     query: Option<Vec<(String, String)>>) -> Arc<RwLock<RequestStatus<(), ()>>> {
        // TODO handle no hosts more gracefully
        let instance = self.get_instance().expect("No hosts left");
        let mut query = match query {
            Some(vec) => {
                let mut vec = vec.clone();
                vec.reserve(2);
                vec
            },
            None => {Vec::with_capacity(2)}
        };
        query.push((String::from_str("u"), self.username.clone()));
        query.push((String::from_str("p"), self.password.clone()));
        let url = self.build_url(instance, path, query);
        let mut builder = self.hyper_client.request(method, url);
        let response = Arc::new(RwLock::new(RequestStatus::new()));
        let moved_response = response.clone();
        Thread::spawn(move || {
        });
        response
    }
fn request ( & mut self , method : Method , path : Vec < String > , query : Option < Vec < ( String , String ) > > ) -> Arc < RwLock < RequestStatus < ( ) , ( ) > > > { // TODO handle no hosts more gracefully let instance = self . get_instance ( ) . expect ( " " ) ; let mut query = match query { Some ( vec ) => { let mut vec = vec . clone ( ) ; vec . reserve ( 2 ) ; vec } , None => { Vec :: with_capacity ( 2 ) } } ; query . push ( ( String :: from_str ( " " ) , self . username . clone ( ) ) ) ; query . push ( ( String :: from_str ( " " ) , self . password . clone ( ) ) ) ; let url = self . build_url ( instance , path , query ) ; let mut builder = self . hyper_client . request ( method , url ) ; let response = Arc :: new ( RwLock :: new ( RequestStatus :: new ( ) ) ) ; let moved_response = response . clone ( ) ; Thread :: spawn ( move | | { } ) ; response }
Builds a request and sends it - returning the request status, which can be
queried like a future
Builds a request and sends it - returning the request status which can be queried like a future
&mut self
method
Method
path
Vec<String>
query
Option<Vec<(String, String)>>
&mut self
method
Method
path
Vec<String>
query
Option<Vec<(String, String)>>