pub async fn place(&self, alpaca: &Alpaca) -> Result<Order> {
      let response = alpaca.request(Method::PATCH, format!("v2/orders/{}", self.id).as_str())?
         .json::<OrderUpdater>(self)
         .send()
         .await.context(error::BadData)?;

      if response.status().is_success() { return Ok(response.json::<Order>().await.context(error::BadData)?) }

      match response.status().as_u16() {
         403 => error::OrderForbidden.fail()?,
         _ => error::Unknown.fail()?
      }
   }
/// Attempts to replace the order.
Attempts to replace the order.
Attempts to replace the order .
pub async fn place(&self, alpaca: &Alpaca) -> Result<Order> {
      let response = alpaca.request(Method::PATCH, format!("v2/orders/{}", self.id).as_str())?
         .json::<OrderUpdater>(self)
         .send()
         .await.context(error::BadData)?;
      if response.status().is_success() { return Ok(response.json::<Order>().await.context(error::BadData)?) }
      match response.status().as_u16() {
         403 => error::OrderForbidden.fail()?,
         _ => error::Unknown.fail()?
      }
   }
pub async fn place ( & self , alpaca : & Alpaca ) -> Result < Order > { let response = alpaca . request ( Method :: PATCH , format ! ( " " self id ) . as_str ( ) ) ? . json :: < OrderUpdater > ( self ) . send ( ) . await . context ( error :: BadData ) ? ; if response . status ( ) . is_success ( ) { return Ok ( response . json :: < Order > ( ) . await . context ( error :: BadData ) ? ) } match response . status ( ) . as_u16 ( ) { 403 => error :: OrderForbidden . fail ( ) ? , _ => error :: Unknown . fail ( ) ? } }
Attempts to replace the order.
Attempts to replace the order .
&self
alpaca
&Alpaca
&self
alpaca
&Alpaca