pub async fn account_positions(
        &self,
        account_number: &str,
    ) -> Result<Vec<AccountPosition>, Box<dyn Error>> {
        #[derive(Serialize, Deserialize)]
        struct AccountPositionsResponse {
            positions: Vec<AccountPosition>,
        }

        let response = self
            .get_request_builder(format!("accounts/{}/positions", account_number).as_str())?
            .send()
            .await?
            .error_for_status()
            .map_err(|e| wrap_error(e))?
            .json::<AccountPositionsResponse>()
            .await?;

        Ok(response.positions)
    }
/// Retrieves positions in a specified account.
Retrieves positions in a specified account.
Retrieves positions in a specified account .
pub async fn account_positions(
        &self,
        account_number: &str,
    ) -> Result<Vec<AccountPosition>, Box<dyn Error>> {
        #[derive(Serialize, Deserialize)]
        struct AccountPositionsResponse {
            positions: Vec<AccountPosition>,
        }
        let response = self
            .get_request_builder(format!("accounts/{}/positions", account_number).as_str())?
            .send()
            .await?
            .error_for_status()
            .map_err(|e| wrap_error(e))?
            .json::<AccountPositionsResponse>()
            .await?;
        Ok(response.positions)
    }
pub async fn account_positions ( & self , account_number : & str , ) -> Result < Vec < AccountPosition > , Box < dyn Error > > { # [ derive ( Serialize Deserialize ) ] struct AccountPositionsResponse { positions : Vec < AccountPosition > , } let response = self . get_request_builder ( format ! ( " " account_number ) . as_str ( ) ) ? . send ( ) . await ? . error_for_status ( ) . map_err ( | e | wrap_error ( e ) ) ? . json :: < AccountPositionsResponse > ( ) . await ? ; Ok ( response . positions ) }
Retrieves positions in a specified account.
Retrieves positions in a specified account .
&self
account_number
&str
&self
account_number
&str