pub struct LeverageParams {
pub symbol: String,
pub leverage: u32,
pub margin_mode: Option<MarginType>,
}Expand description
Parameters for setting leverage.
§Example
use ccxt_core::types::params::LeverageParams;
use ccxt_core::types::position::MarginType;
let params = LeverageParams::new("BTC/USDT:USDT", 10)
.margin_mode(MarginType::Isolated);Fields§
§symbol: StringTrading symbol.
leverage: u32Leverage multiplier.
margin_mode: Option<MarginType>Margin mode (cross or isolated).
Implementations§
Source§impl LeverageParams
impl LeverageParams
Sourcepub fn new(symbol: &str, leverage: u32) -> LeverageParams
pub fn new(symbol: &str, leverage: u32) -> LeverageParams
Create new leverage parameters.
Sourcepub fn cross(self) -> LeverageParams
pub fn cross(self) -> LeverageParams
Set margin mode to cross.
Sourcepub fn isolated(self) -> LeverageParams
pub fn isolated(self) -> LeverageParams
Set margin mode to isolated.
Sourcepub fn margin_mode(self, mode: MarginType) -> LeverageParams
pub fn margin_mode(self, mode: MarginType) -> LeverageParams
Set the margin mode explicitly.
Trait Implementations§
Source§impl Clone for LeverageParams
impl Clone for LeverageParams
Source§fn clone(&self) -> LeverageParams
fn clone(&self) -> LeverageParams
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for LeverageParams
impl RefUnwindSafe for LeverageParams
impl Send for LeverageParams
impl Sync for LeverageParams
impl Unpin for LeverageParams
impl UnwindSafe for LeverageParams
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