OrderRequestBuilder

Struct OrderRequestBuilder 

Source
pub struct OrderRequestBuilder { /* private fields */ }
Expand description

The initial stage of an Order, this is what is sent to the route for creating a Order.

Implementations§

Source§

impl OrderRequestBuilder

Source

pub fn new() -> Self

Initialize a new builder for OrderRequest.

Source

pub fn account_id(self, id: impl Into<String>) -> Self

Set the Account ID the OrderRequest belongs to.

NOTE: Required to be set to build an OrderRequest.

Source

pub fn order_type(self, order_type: OrderType) -> Self

Set the Order Type for the OrderRequest.

NOTE: Required to be set to build an OrderRequest.

Source

pub fn symbol(self, symbol: impl Into<String>) -> Self

Set the Symbol the OrderRequest is for.

NOTE: Required to be set to build an OrderRequest.

Source

pub fn time_in_force(self, time_in_force: OrderTimeInForce) -> Self

Set the Time In Force (Duration or expiration timestamp) for the OrderRequest.

NOTE: Required to be set to build an OrderRequest.

Source

pub fn quantity(self, quantity: impl Into<String>) -> Self

Set the Quantity of shares or contracts for the OrderRequest.

Source

pub fn trade_action(self, action: TradeAction) -> Self

Set the Trade Action for the OrderRequest.

NOTE: Required to be set to build an OrderRequest.

Source

pub fn route(self, route: impl Into<String>) -> Self

Set the Execution Route for the OrderRequest.

Source

pub fn stop_price(self, price: impl Into<String>) -> Self

Set a Stop Price for the OrderRequest.

Source

pub fn order_confirm_id(self, id: impl Into<String>) -> Self

Set an Order Confirm ID for the OrderRequest.

Source

pub fn osos(self, osos: Vec<Oso>) -> Self

Set the Order Sends Order for the OrderRequest.

Source

pub fn limit_price(self, price: impl Into<String>) -> Self

Set a Limit Price for the OrderRequest.

Source

pub fn legs(self, legs: Vec<OrderRequestLeg>) -> Self

Set the Legs of the OrderRequest.

Source

pub fn buying_power_warning(self, status: BPWarningStatus) -> Self

Set the Buying Power Warning Status for the OrderRequest.

Source

pub fn advanced_options(self, options: AdvancedOrderOptions) -> Self

Set the Advanced Options for the OrderRequest.

Source

pub fn build(self) -> Result<OrderRequest, Error>

Finish building the OrderRequest.

NOTE: account_id, order_type, quantity, symbol, time_in_force, and trade_action are all required.

Trait Implementations§

Source§

impl Debug for OrderRequestBuilder

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for OrderRequestBuilder

Source§

fn default() -> OrderRequestBuilder

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> ErasedDestructor for T
where T: 'static,