pub struct PositionHTTP { /* private fields */ }Trait Implementations§
Source§impl Position for PositionHTTP
impl Position for PositionHTTP
Source§fn get_position<'life0, 'async_trait>(
&'life0 self,
query: HashMap<String, String>,
) -> Pin<Box<dyn Future<Output = Result<Value, Box<dyn Error + Send + Sync + 'static>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_position<'life0, 'async_trait>(
&'life0 self,
query: HashMap<String, String>,
) -> Pin<Box<dyn Future<Output = Result<Value, Box<dyn Error + Send + Sync + 'static>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Query real-time position data, such as position size, cumulative realizedPNL. Required args: category (string): Product type Unified account: linear, option Normal account: linear, inverse. Please note that category is not involved with business logic Returns: Request results as HashMap. Additional information: https://bybit-exchange.github.io/docs/v5/position
Source§fn set_leverage<'life0, 'async_trait>(
&'life0 self,
query: HashMap<String, String>,
) -> Pin<Box<dyn Future<Output = Result<Value, Box<dyn Error + Send + Sync + 'static>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn set_leverage<'life0, 'async_trait>(
&'life0 self,
query: HashMap<String, String>,
) -> Pin<Box<dyn Future<Output = Result<Value, Box<dyn Error + Send + Sync + 'static>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Set the leverage Required args: category (string): Product type Unified account: linear Normal account: linear, inverse. Please note that category is not involved with business logic symbol (string): Symbol name buyLeverage (string): [0, max leverage of corresponding risk limit]. Note: Under one-way mode, buyLeverage must be the same as sellLeverage sellLeverage (string): [0, max leverage of corresponding risk limit]. Note: Under one-way mode, buyLeverage must be the same as sellLeverage Returns: Request results as HashMap. Additional information: https://bybit-exchange.github.io/docs/v5/position/leverage
Source§fn switch_margin_mode<'life0, 'async_trait>(
&'life0 self,
query: HashMap<String, String>,
) -> Pin<Box<dyn Future<Output = Result<Value, Box<dyn Error + Send + Sync + 'static>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn switch_margin_mode<'life0, 'async_trait>(
&'life0 self,
query: HashMap<String, String>,
) -> Pin<Box<dyn Future<Output = Result<Value, Box<dyn Error + Send + Sync + 'static>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Select cross margin mode or isolated margin mode Required args: category (string): Product type. linear,inverse Please note that category is not involved with business logicUnified account is not applicable symbol (string): Symbol name tradeMode (integer): 0: cross margin. 1: isolated margin buyLeverage (string): The value must be equal to sellLeverage value sellLeverage (string): The value must be equal to buyLeverage value Returns: Request results as HashMap. Additional information: https://bybit-exchange.github.io/docs/v5/position/cross-isolate
Source§fn set_tp_sl_mode<'life0, 'async_trait>(
&'life0 self,
query: HashMap<String, String>,
) -> Pin<Box<dyn Future<Output = Result<Value, Box<dyn Error + Send + Sync + 'static>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn set_tp_sl_mode<'life0, 'async_trait>(
&'life0 self,
query: HashMap<String, String>,
) -> Pin<Box<dyn Future<Output = Result<Value, Box<dyn Error + Send + Sync + 'static>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Set TP/SL mode to Full or Partial Required args: category (string): Product type Unified account: linear Normal account: linear, inverse. Please note that category is not involved with business logic symbol (string): Symbol name tpSlMode (string): TP/SL mode. Full,Partial Returns: Request results as HashMap. Additional information: https://bybit-exchange.github.io/docs/v5/position/tpsl-mode
Source§fn switch_position_mode<'life0, 'async_trait>(
&'life0 self,
query: HashMap<String, String>,
) -> Pin<Box<dyn Future<Output = Result<Value, Box<dyn Error + Send + Sync + 'static>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn switch_position_mode<'life0, 'async_trait>(
&'life0 self,
query: HashMap<String, String>,
) -> Pin<Box<dyn Future<Output = Result<Value, Box<dyn Error + Send + Sync + 'static>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
It supports to switch the position mode for USDT perpetual and Inverse futures. If you are in one-way Mode, you can only open one position on Buy or Sell side. If you are in hedge mode, you can open both Buy and Sell side positions simultaneously. Required args: category (string): Product type. linear,inverse Please note that category is not involved with business logicUnified account is not applicable Returns: Request results as HashMap. Additional information: https://bybit-exchange.github.io/docs/v5/position/position-mode
Source§fn set_risk_limit<'life0, 'async_trait>(
&'life0 self,
query: HashMap<String, String>,
) -> Pin<Box<dyn Future<Output = Result<Value, Box<dyn Error + Send + Sync + 'static>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn set_risk_limit<'life0, 'async_trait>(
&'life0 self,
query: HashMap<String, String>,
) -> Pin<Box<dyn Future<Output = Result<Value, Box<dyn Error + Send + Sync + 'static>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
The risk limit will limit the maximum position value you can hold under different margin requirements. If you want to hold a bigger position size, you need more margin. This interface can set the risk limit of a single position. If the order exceeds the current risk limit when placing an order, it will be rejected. Click here to learn more about risk limit. Required args: category (string): Product type Unified account: linear Normal account: linear, inverse. Please note that category is not involved with business logic symbol (string): Symbol name riskId (integer): Risk limit ID Returns: Request results as HashMap. Additional information: https://bybit-exchange.github.io/docs/v5/position/set-risk-limit
Source§fn set_trading_stop<'life0, 'async_trait>(
&'life0 self,
query: HashMap<String, String>,
) -> Pin<Box<dyn Future<Output = Result<Value, Box<dyn Error + Send + Sync + 'static>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn set_trading_stop<'life0, 'async_trait>(
&'life0 self,
query: HashMap<String, String>,
) -> Pin<Box<dyn Future<Output = Result<Value, Box<dyn Error + Send + Sync + 'static>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Set the trading stop condition Required args: category (string): Product type Unified account: linear Normal account: linear, inverse. Please note that category is not involved with business logic symbol (string): Symbol name Returns: Request results as HashMap. Additional information: https://bybit-exchange.github.io/docs/v5/position/trading-stop
Source§fn set_auto_add_margin<'life0, 'async_trait>(
&'life0 self,
query: HashMap<String, String>,
) -> Pin<Box<dyn Future<Output = Result<Value, Box<dyn Error + Send + Sync + 'static>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn set_auto_add_margin<'life0, 'async_trait>(
&'life0 self,
query: HashMap<String, String>,
) -> Pin<Box<dyn Future<Output = Result<Value, Box<dyn Error + Send + Sync + 'static>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Turn on/off auto-add-margin for isolated margin position Required args: category (string): Product type. linear symbol (string): Symbol name autoAddMargin (integer): Turn on/off. 0: off. 1: on Returns: Request results as HashMap. Additional information: https://bybit-exchange.github.io/docs/v5/position/add-margin
Source§fn get_executions<'life0, 'async_trait>(
&'life0 self,
query: HashMap<String, String>,
) -> Pin<Box<dyn Future<Output = Result<Value, Box<dyn Error + Send + Sync + 'static>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_executions<'life0, 'async_trait>(
&'life0 self,
query: HashMap<String, String>,
) -> Pin<Box<dyn Future<Output = Result<Value, Box<dyn Error + Send + Sync + 'static>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Query users’ execution records, sorted by execTime in descending order Required args: category (string): Product type Unified account: spot, linear, option Normal account: linear, inverse. Please note that category is not involved with business logic Returns: Request results as HashMap. Additional information: https://bybit-exchange.github.io/docs/v5/position/execution
Source§fn get_closed_pnl<'life0, 'async_trait>(
&'life0 self,
query: HashMap<String, String>,
) -> Pin<Box<dyn Future<Output = Result<Value, Box<dyn Error + Send + Sync + 'static>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_closed_pnl<'life0, 'async_trait>(
&'life0 self,
query: HashMap<String, String>,
) -> Pin<Box<dyn Future<Output = Result<Value, Box<dyn Error + Send + Sync + 'static>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Query user’s closed profit and loss records. The results are sorted by createdTime in descending order. Required args: category (string): Product type Unified account: linear Normal account: linear, inverse. Please note that category is not involved with business logic Returns: Request results as HashMap. Additional information: https://bybit-exchange.github.io/docs/v5/position/close-pnl
fn new(http_manager: Arc<HttpManager>) -> Self
Auto Trait Implementations§
impl Freeze for PositionHTTP
impl !RefUnwindSafe for PositionHTTP
impl Send for PositionHTTP
impl Sync for PositionHTTP
impl Unpin for PositionHTTP
impl UnsafeUnpin for PositionHTTP
impl !UnwindSafe for PositionHTTP
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more