pub async fn current_user(&self) -> Result<CurrentUser, APIError> {
        // Build the request.
        let rb = self.request(Method::GET, "/v1/me");
        let request = rb.build().unwrap();

        let resp = self.client.execute(request).await.unwrap();
        match resp.status() {
            StatusCode::OK => (),
            s => {
                return Err(APIError {
                    status_code: s,
                    body: resp.text().await.unwrap(),
                })
            }
        };

        // Try to deserialize the response.
        let result: CurrentUser = resp.json().await.unwrap();

        Ok(result)
    }
/// Get information about the current user.
Get information about the current user.
Get information about the current user .
pub async fn current_user(&self) -> Result<CurrentUser, APIError> {
        // Build the request.
        let rb = self.request(Method::GET, "/v1/me");
        let request = rb.build().unwrap();
        let resp = self.client.execute(request).await.unwrap();
        match resp.status() {
            StatusCode::OK => (),
            s => {
                return Err(APIError {
                    status_code: s,
                    body: resp.text().await.unwrap(),
                })
            }
        };
        // Try to deserialize the response.
        let result: CurrentUser = resp.json().await.unwrap();
        Ok(result)
    }
pub async fn current_user ( & self ) -> Result < CurrentUser , APIError > { // Build the request. let rb = self . request ( Method :: GET , " " ) ; let request = rb . build ( ) . unwrap ( ) ; let resp = self . client . execute ( request ) . await . unwrap ( ) ; match resp . status ( ) { StatusCode :: OK => ( ) , s => { return Err ( APIError { status_code : s , body : resp . text ( ) . await . unwrap ( ) , } ) } } ; // Try to deserialize the response. let result : CurrentUser = resp . json ( ) . await . unwrap ( ) ; Ok ( result ) }
Get information about the current user.
Get information about the current user .
&self
&self