pub struct MarketActionsBuilder {
market: Market,
actions: Vec<Action>,
first_error: Option<O2Error>,
}Expand description
Builder for composing a batch of actions against a single market.
Construct via O2Client::actions_for. Builder methods are infallible and
defer validation errors until MarketActionsBuilder::build.
Fields§
§market: Market§actions: Vec<Action>§first_error: Option<O2Error>Implementations§
Source§impl MarketActionsBuilder
impl MarketActionsBuilder
fn new(market: Market) -> Self
fn record_error_once(&mut self, err: O2Error)
Sourcepub fn settle_balance(self) -> Self
pub fn settle_balance(self) -> Self
Add a settle-balance action.
Sourcepub fn cancel_order(self, order_id: impl IntoValidId<OrderId>) -> Self
pub fn cancel_order(self, order_id: impl IntoValidId<OrderId>) -> Self
Add a cancel-order action.
Sourcepub fn create_order<P, Q>(
self,
side: Side,
price: P,
quantity: Q,
order_type: OrderType,
) -> Selfwhere
P: TryInto<OrderPriceInput, Error = O2Error>,
Q: TryInto<OrderQuantityInput, Error = O2Error>,
pub fn create_order<P, Q>(
self,
side: Side,
price: P,
quantity: Q,
order_type: OrderType,
) -> Selfwhere
P: TryInto<OrderPriceInput, Error = O2Error>,
Q: TryInto<OrderQuantityInput, Error = O2Error>,
Add a create-order action.
Accepts the same flexible price/quantity inputs as O2Client::create_order:
typed wrappers, UnsignedDecimal, and decimal strings.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for MarketActionsBuilder
impl RefUnwindSafe for MarketActionsBuilder
impl Send for MarketActionsBuilder
impl Sync for MarketActionsBuilder
impl Unpin for MarketActionsBuilder
impl UnwindSafe for MarketActionsBuilder
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