pub struct CoinbaseWebsocketTrading { /* private fields */ }Expand description
Coinbase WebSocket trading implementation
Implementations§
Source§impl CoinbaseWebsocketTrading
impl CoinbaseWebsocketTrading
Sourcepub fn parse_level2_snapshot(msg: &JsonValue) -> Result<OrderBook>
pub fn parse_level2_snapshot(msg: &JsonValue) -> Result<OrderBook>
Parse level2 snapshot message into OrderBook
Sourcepub fn parse_level2_update(
msg: &JsonValue,
) -> Result<(SmartString, Vec<(SmartString, Decimal, Decimal)>)>
pub fn parse_level2_update( msg: &JsonValue, ) -> Result<(SmartString, Vec<(SmartString, Decimal, Decimal)>)>
Parse level2 update message
Sourcepub fn apply_level2_update(
order_book: &mut OrderBook,
changes: &[(SmartString, Decimal, Decimal)],
)
pub fn apply_level2_update( order_book: &mut OrderBook, changes: &[(SmartString, Decimal, Decimal)], )
Apply level2 updates to an order book
Trait Implementations§
Source§impl Exchange for CoinbaseWebsocketTrading
impl Exchange for CoinbaseWebsocketTrading
Source§fn place_order<'life0, 'async_trait>(
&'life0 self,
order: Order,
report_sender: Sender<ExecutionReport>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn place_order<'life0, 'async_trait>(
&'life0 self,
order: Order,
report_sender: Sender<ExecutionReport>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Places a new order on the exchange
Source§fn cancel_order<'life0, 'async_trait>(
&'life0 self,
order_id: SmartString,
report_sender: Sender<ExecutionReport>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn cancel_order<'life0, 'async_trait>(
&'life0 self,
order_id: SmartString,
report_sender: Sender<ExecutionReport>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Cancels an existing order
Source§fn modify_order<'life0, 'async_trait>(
&'life0 self,
order_id: SmartString,
new_price: Option<Decimal>,
new_quantity: Option<Decimal>,
report_sender: Sender<ExecutionReport>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn modify_order<'life0, 'async_trait>(
&'life0 self,
order_id: SmartString,
new_price: Option<Decimal>,
new_quantity: Option<Decimal>,
report_sender: Sender<ExecutionReport>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Modifies an existing order
Source§fn cancel_all_orders<'life0, 'async_trait>(
&'life0 self,
instrument_id: Option<InstrumentId>,
report_sender: Sender<ExecutionReport>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn cancel_all_orders<'life0, 'async_trait>(
&'life0 self,
instrument_id: Option<InstrumentId>,
report_sender: Sender<ExecutionReport>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Cancels all open orders, optionally filtered by instrument
Source§fn get_order_status<'life0, 'life1, 'async_trait>(
&'life0 self,
order_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<OrderStatus>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_order_status<'life0, 'life1, 'async_trait>(
&'life0 self,
order_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<OrderStatus>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Retrieves the status of an order
Source§fn connect<'life0, 'async_trait>(
&'life0 self,
report_sender: Sender<ExecutionReport>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn connect<'life0, 'async_trait>(
&'life0 self,
report_sender: Sender<ExecutionReport>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Connects to the exchange
Source§fn disconnect<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn disconnect<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Disconnects from the exchange
Source§fn is_connected<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn is_connected<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Checks if connected to the exchange
Source§fn get_instruments<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<SmallVec<[InstrumentId; 32]>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_instruments<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<SmallVec<[InstrumentId; 32]>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Gets a list of instruments supported by this exchange
Auto Trait Implementations§
impl Freeze for CoinbaseWebsocketTrading
impl !RefUnwindSafe for CoinbaseWebsocketTrading
impl Send for CoinbaseWebsocketTrading
impl Sync for CoinbaseWebsocketTrading
impl Unpin for CoinbaseWebsocketTrading
impl !UnwindSafe for CoinbaseWebsocketTrading
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