pub struct OrderBuilder { /* private fields */ }Expand description
Builder for creating new orders.
§Example
use binance_api_client::api::account::OrderBuilder;
use binance_api_client::{OrderSide, OrderType, TimeInForce};
let order = OrderBuilder::new("BTCUSDT", OrderSide::Buy, OrderType::Limit)
.quantity("0.001")
.price("50000.00")
.time_in_force(TimeInForce::GTC)
.build();Implementations§
Source§impl OrderBuilder
impl OrderBuilder
Sourcepub fn new(symbol: &str, side: OrderSide, order_type: OrderType) -> Self
pub fn new(symbol: &str, side: OrderSide, order_type: OrderType) -> Self
Create a new order builder.
Sourcepub fn quote_quantity(self, quantity: &str) -> Self
pub fn quote_quantity(self, quantity: &str) -> Self
Set the quote order quantity (for market orders).
Sourcepub fn stop_price(self, price: &str) -> Self
pub fn stop_price(self, price: &str) -> Self
Set the stop price (for stop orders).
Sourcepub fn time_in_force(self, tif: TimeInForce) -> Self
pub fn time_in_force(self, tif: TimeInForce) -> Self
Set the time in force.
Sourcepub fn client_order_id(self, id: &str) -> Self
pub fn client_order_id(self, id: &str) -> Self
Set a custom client order ID.
Sourcepub fn iceberg_qty(self, qty: &str) -> Self
pub fn iceberg_qty(self, qty: &str) -> Self
Set the iceberg quantity.
Sourcepub fn response_type(self, resp_type: OrderResponseType) -> Self
pub fn response_type(self, resp_type: OrderResponseType) -> Self
Set the response type.
Trait Implementations§
Source§impl Clone for OrderBuilder
impl Clone for OrderBuilder
Source§fn clone(&self) -> OrderBuilder
fn clone(&self) -> OrderBuilder
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 OrderBuilder
impl RefUnwindSafe for OrderBuilder
impl Send for OrderBuilder
impl Sync for OrderBuilder
impl Unpin for OrderBuilder
impl UnwindSafe for OrderBuilder
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