pub struct SetLeverageRequest {
pub category: Category,
pub symbol: String,
pub buy_leverage: Decimal,
pub sell_leverage: Decimal,
}Expand description
Request body of POST /v5/position/set-leverage (Client::set_leverage).
Fields§
§category: Categorylinear, inverse
symbol: StringSymbol name, like BTCUSDT, uppercase only.
buy_leverage: DecimalUnder cross margin mode: 0 < leverage ≤ maxLeverage (must equal sellLeverage). Under isolated margin mode: 0 < leverage ≤ maxLeverage.
sell_leverage: Decimal[ 1, max leverage].
Implementations§
Source§impl SetLeverageRequest
impl SetLeverageRequest
Sourcepub fn new(
category: Category,
symbol: impl Into<String>,
leverage: Decimal,
) -> Self
pub fn new( category: Category, symbol: impl Into<String>, leverage: Decimal, ) -> Self
Create with the required fields; set the optional ones with the with_* methods.
Sourcepub fn with_asymmetric(
self,
buy_leverage: Decimal,
sell_leverage: Decimal,
) -> Self
pub fn with_asymmetric( self, buy_leverage: Decimal, sell_leverage: Decimal, ) -> Self
Different leverage for the buy and sell side (isolated margin only).
Trait Implementations§
Source§impl Clone for SetLeverageRequest
impl Clone for SetLeverageRequest
Source§impl Debug for SetLeverageRequest
impl Debug for SetLeverageRequest
Auto Trait Implementations§
impl Freeze for SetLeverageRequest
impl RefUnwindSafe for SetLeverageRequest
impl Send for SetLeverageRequest
impl Sync for SetLeverageRequest
impl Unpin for SetLeverageRequest
impl UnsafeUnpin for SetLeverageRequest
impl UnwindSafe for SetLeverageRequest
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
Mutably borrows from an owned value. Read more