@@ -21,88 +21,32 @@ use nautilus_model::{
21
21
identifiers:: { ClientId , Venue } ,
22
22
} ;
23
23
24
- pub mod request_bars;
25
- pub mod request_book_snapshot;
26
- pub mod request_data;
27
- pub mod request_instrument;
28
- pub mod request_instruments;
29
- pub mod request_quotes;
30
- pub mod request_trades;
31
- pub mod response_bars;
32
- pub mod response_book_snapshot;
33
- pub mod response_data;
34
- pub mod response_instrument;
35
- pub mod response_instruments;
36
- pub mod response_quotes;
37
- pub mod response_trades;
38
- pub mod subscribe_bars;
39
- pub mod subscribe_book_deltas;
40
- pub mod subscribe_book_depth10;
41
- pub mod subscribe_book_snapshots;
42
- pub mod subscribe_close;
43
- pub mod subscribe_data;
44
- pub mod subscribe_index_prices;
45
- pub mod subscribe_instrument;
46
- pub mod subscribe_instruments;
47
- pub mod subscribe_mark_prices;
48
- pub mod subscribe_quotes;
49
- pub mod subscribe_status;
50
- pub mod subscribe_trades;
51
- pub mod unsubscribe_bars;
52
- pub mod unsubscribe_book_deltas;
53
- pub mod unsubscribe_book_depth10;
54
- pub mod unsubscribe_book_snapshots;
55
- pub mod unsubscribe_close;
56
- pub mod unsubscribe_data;
57
- pub mod unsubscribe_index_prices;
58
- pub mod unsubscribe_instrument;
59
- pub mod unsubscribe_instruments;
60
- pub mod unsubscribe_mark_prices;
61
- pub mod unsubscribe_quotes;
62
- pub mod unsubscribe_status;
63
- pub mod unsubscribe_trades;
24
+ pub mod request;
25
+ pub mod response;
26
+ pub mod subscribe;
27
+ pub mod unsubscribe;
64
28
65
29
// Re-exports
66
- pub use request_bars:: RequestBars ;
67
- pub use request_book_snapshot:: RequestBookSnapshot ;
68
- pub use request_data:: RequestCustomData ;
69
- pub use request_instrument:: RequestInstrument ;
70
- pub use request_instruments:: RequestInstruments ;
71
- pub use request_quotes:: RequestQuotes ;
72
- pub use request_trades:: RequestTrades ;
73
- pub use response_bars:: BarsResponse ;
74
- pub use response_book_snapshot:: BookResponse ;
75
- pub use response_data:: CustomDataResponse ;
76
- pub use response_instrument:: InstrumentResponse ;
77
- pub use response_instruments:: InstrumentsResponse ;
78
- pub use response_quotes:: QuotesResponse ;
79
- pub use response_trades:: TradesResponse ;
80
- pub use subscribe_bars:: SubscribeBars ;
81
- pub use subscribe_book_deltas:: SubscribeBookDeltas ;
82
- pub use subscribe_book_depth10:: SubscribeBookDepth10 ;
83
- pub use subscribe_book_snapshots:: SubscribeBookSnapshots ;
84
- pub use subscribe_close:: SubscribeInstrumentClose ;
85
- pub use subscribe_data:: SubscribeCustomData ;
86
- pub use subscribe_index_prices:: SubscribeIndexPrices ;
87
- pub use subscribe_instrument:: SubscribeInstrument ;
88
- pub use subscribe_instruments:: SubscribeInstruments ;
89
- pub use subscribe_mark_prices:: SubscribeMarkPrices ;
90
- pub use subscribe_quotes:: SubscribeQuotes ;
91
- pub use subscribe_status:: SubscribeInstrumentStatus ;
92
- pub use subscribe_trades:: SubscribeTrades ;
93
- pub use unsubscribe_bars:: UnsubscribeBars ;
94
- pub use unsubscribe_book_deltas:: UnsubscribeBookDeltas ;
95
- pub use unsubscribe_book_depth10:: UnsubscribeBookDepth10 ;
96
- pub use unsubscribe_book_snapshots:: UnsubscribeBookSnapshots ;
97
- pub use unsubscribe_close:: UnsubscribeInstrumentClose ;
98
- pub use unsubscribe_data:: UnsubscribeCustomData ;
99
- pub use unsubscribe_index_prices:: UnsubscribeIndexPrices ;
100
- pub use unsubscribe_instrument:: UnsubscribeInstrument ;
101
- pub use unsubscribe_instruments:: UnsubscribeInstruments ;
102
- pub use unsubscribe_mark_prices:: UnsubscribeMarkPrices ;
103
- pub use unsubscribe_quotes:: UnsubscribeQuotes ;
104
- pub use unsubscribe_status:: UnsubscribeInstrumentStatus ;
105
- pub use unsubscribe_trades:: UnsubscribeTrades ;
30
+ pub use request:: {
31
+ RequestBars , RequestBookSnapshot , RequestCustomData , RequestInstrument , RequestInstruments ,
32
+ RequestQuotes , RequestTrades ,
33
+ } ;
34
+ pub use response:: {
35
+ BarsResponse , BookResponse , CustomDataResponse , InstrumentResponse , InstrumentsResponse ,
36
+ QuotesResponse , TradesResponse ,
37
+ } ;
38
+ pub use subscribe:: {
39
+ SubscribeBars , SubscribeBookDeltas , SubscribeBookDepth10 , SubscribeBookSnapshots ,
40
+ SubscribeCustomData , SubscribeIndexPrices , SubscribeInstrument , SubscribeInstrumentClose ,
41
+ SubscribeInstrumentStatus , SubscribeInstruments , SubscribeMarkPrices , SubscribeQuotes ,
42
+ SubscribeTrades ,
43
+ } ;
44
+ pub use unsubscribe:: {
45
+ UnsubscribeBars , UnsubscribeBookDeltas , UnsubscribeBookDepth10 , UnsubscribeBookSnapshots ,
46
+ UnsubscribeCustomData , UnsubscribeIndexPrices , UnsubscribeInstrument ,
47
+ UnsubscribeInstrumentClose , UnsubscribeInstrumentStatus , UnsubscribeInstruments ,
48
+ UnsubscribeMarkPrices , UnsubscribeQuotes , UnsubscribeTrades ,
49
+ } ;
106
50
107
51
#[ derive( Clone , Debug , PartialEq ) ]
108
52
pub enum DataCommand {
@@ -121,8 +65,8 @@ impl DataCommand {
121
65
#[ derive( Clone , Debug ) ]
122
66
pub enum SubscribeCommand {
123
67
Data ( SubscribeCustomData ) ,
124
- Instruments ( SubscribeInstruments ) ,
125
68
Instrument ( SubscribeInstrument ) ,
69
+ Instruments ( SubscribeInstruments ) ,
126
70
BookDeltas ( SubscribeBookDeltas ) ,
127
71
BookDepth10 ( SubscribeBookDepth10 ) ,
128
72
BookSnapshots ( SubscribeBookSnapshots ) ,
@@ -150,8 +94,8 @@ impl SubscribeCommand {
150
94
pub fn command_id ( & self ) -> UUID4 {
151
95
match self {
152
96
Self :: Data ( cmd) => cmd. command_id ,
153
- Self :: Instruments ( cmd) => cmd. command_id ,
154
97
Self :: Instrument ( cmd) => cmd. command_id ,
98
+ Self :: Instruments ( cmd) => cmd. command_id ,
155
99
Self :: BookDeltas ( cmd) => cmd. command_id ,
156
100
Self :: BookDepth10 ( cmd) => cmd. command_id ,
157
101
Self :: BookSnapshots ( cmd) => cmd. command_id ,
@@ -168,8 +112,8 @@ impl SubscribeCommand {
168
112
pub fn client_id ( & self ) -> Option < & ClientId > {
169
113
match self {
170
114
Self :: Data ( cmd) => cmd. client_id . as_ref ( ) ,
171
- Self :: Instruments ( cmd) => cmd. client_id . as_ref ( ) ,
172
115
Self :: Instrument ( cmd) => cmd. client_id . as_ref ( ) ,
116
+ Self :: Instruments ( cmd) => cmd. client_id . as_ref ( ) ,
173
117
Self :: BookDeltas ( cmd) => cmd. client_id . as_ref ( ) ,
174
118
Self :: BookDepth10 ( cmd) => cmd. client_id . as_ref ( ) ,
175
119
Self :: BookSnapshots ( cmd) => cmd. client_id . as_ref ( ) ,
@@ -186,8 +130,8 @@ impl SubscribeCommand {
186
130
pub fn venue ( & self ) -> Option < & Venue > {
187
131
match self {
188
132
Self :: Data ( cmd) => cmd. venue . as_ref ( ) ,
189
- Self :: Instruments ( cmd) => Some ( & cmd. venue ) ,
190
133
Self :: Instrument ( cmd) => cmd. venue . as_ref ( ) ,
134
+ Self :: Instruments ( cmd) => Some ( & cmd. venue ) ,
191
135
Self :: BookDeltas ( cmd) => cmd. venue . as_ref ( ) ,
192
136
Self :: BookDepth10 ( cmd) => cmd. venue . as_ref ( ) ,
193
137
Self :: BookSnapshots ( cmd) => cmd. venue . as_ref ( ) ,
@@ -204,8 +148,8 @@ impl SubscribeCommand {
204
148
pub fn ts_init ( & self ) -> UnixNanos {
205
149
match self {
206
150
Self :: Data ( cmd) => cmd. ts_init ,
207
- Self :: Instruments ( cmd) => cmd. ts_init ,
208
151
Self :: Instrument ( cmd) => cmd. ts_init ,
152
+ Self :: Instruments ( cmd) => cmd. ts_init ,
209
153
Self :: BookDeltas ( cmd) => cmd. ts_init ,
210
154
Self :: BookDepth10 ( cmd) => cmd. ts_init ,
211
155
Self :: BookSnapshots ( cmd) => cmd. ts_init ,
@@ -223,8 +167,8 @@ impl SubscribeCommand {
223
167
#[ derive( Clone , Debug ) ]
224
168
pub enum UnsubscribeCommand {
225
169
Data ( UnsubscribeCustomData ) ,
226
- Instruments ( UnsubscribeInstruments ) ,
227
170
Instrument ( UnsubscribeInstrument ) ,
171
+ Instruments ( UnsubscribeInstruments ) ,
228
172
BookDeltas ( UnsubscribeBookDeltas ) ,
229
173
BookDepth10 ( UnsubscribeBookDepth10 ) ,
230
174
BookSnapshots ( UnsubscribeBookSnapshots ) ,
@@ -252,8 +196,8 @@ impl UnsubscribeCommand {
252
196
pub fn command_id ( & self ) -> UUID4 {
253
197
match self {
254
198
Self :: Data ( cmd) => cmd. command_id ,
255
- Self :: Instruments ( cmd) => cmd. command_id ,
256
199
Self :: Instrument ( cmd) => cmd. command_id ,
200
+ Self :: Instruments ( cmd) => cmd. command_id ,
257
201
Self :: BookDeltas ( cmd) => cmd. command_id ,
258
202
Self :: BookDepth10 ( cmd) => cmd. command_id ,
259
203
Self :: BookSnapshots ( cmd) => cmd. command_id ,
@@ -270,8 +214,8 @@ impl UnsubscribeCommand {
270
214
pub fn client_id ( & self ) -> Option < & ClientId > {
271
215
match self {
272
216
Self :: Data ( cmd) => cmd. client_id . as_ref ( ) ,
273
- Self :: Instruments ( cmd) => cmd. client_id . as_ref ( ) ,
274
217
Self :: Instrument ( cmd) => cmd. client_id . as_ref ( ) ,
218
+ Self :: Instruments ( cmd) => cmd. client_id . as_ref ( ) ,
275
219
Self :: BookDeltas ( cmd) => cmd. client_id . as_ref ( ) ,
276
220
Self :: BookDepth10 ( cmd) => cmd. client_id . as_ref ( ) ,
277
221
Self :: BookSnapshots ( cmd) => cmd. client_id . as_ref ( ) ,
@@ -288,8 +232,8 @@ impl UnsubscribeCommand {
288
232
pub fn venue ( & self ) -> Option < & Venue > {
289
233
match self {
290
234
Self :: Data ( cmd) => cmd. venue . as_ref ( ) ,
291
- Self :: Instruments ( cmd) => Some ( & cmd. venue ) ,
292
235
Self :: Instrument ( cmd) => cmd. venue . as_ref ( ) ,
236
+ Self :: Instruments ( cmd) => Some ( & cmd. venue ) ,
293
237
Self :: BookDeltas ( cmd) => cmd. venue . as_ref ( ) ,
294
238
Self :: BookDepth10 ( cmd) => cmd. venue . as_ref ( ) ,
295
239
Self :: BookSnapshots ( cmd) => cmd. venue . as_ref ( ) ,
@@ -306,8 +250,8 @@ impl UnsubscribeCommand {
306
250
pub fn ts_init ( & self ) -> UnixNanos {
307
251
match self {
308
252
Self :: Data ( cmd) => cmd. ts_init ,
309
- Self :: Instruments ( cmd) => cmd. ts_init ,
310
253
Self :: Instrument ( cmd) => cmd. ts_init ,
254
+ Self :: Instruments ( cmd) => cmd. ts_init ,
311
255
Self :: BookDeltas ( cmd) => cmd. ts_init ,
312
256
Self :: BookDepth10 ( cmd) => cmd. ts_init ,
313
257
Self :: BookSnapshots ( cmd) => cmd. ts_init ,
@@ -355,8 +299,8 @@ impl RequestCommand {
355
299
pub fn request_id ( & self ) -> & UUID4 {
356
300
match self {
357
301
Self :: Data ( cmd) => & cmd. request_id ,
358
- Self :: Instruments ( cmd) => & cmd. request_id ,
359
302
Self :: Instrument ( cmd) => & cmd. request_id ,
303
+ Self :: Instruments ( cmd) => & cmd. request_id ,
360
304
Self :: BookSnapshot ( cmd) => & cmd. request_id ,
361
305
Self :: Quotes ( cmd) => & cmd. request_id ,
362
306
Self :: Trades ( cmd) => & cmd. request_id ,
@@ -367,8 +311,8 @@ impl RequestCommand {
367
311
pub fn client_id ( & self ) -> Option < & ClientId > {
368
312
match self {
369
313
Self :: Data ( cmd) => Some ( & cmd. client_id ) ,
370
- Self :: Instruments ( cmd) => cmd. client_id . as_ref ( ) ,
371
314
Self :: Instrument ( cmd) => cmd. client_id . as_ref ( ) ,
315
+ Self :: Instruments ( cmd) => cmd. client_id . as_ref ( ) ,
372
316
Self :: BookSnapshot ( cmd) => cmd. client_id . as_ref ( ) ,
373
317
Self :: Quotes ( cmd) => cmd. client_id . as_ref ( ) ,
374
318
Self :: Trades ( cmd) => cmd. client_id . as_ref ( ) ,
@@ -379,8 +323,8 @@ impl RequestCommand {
379
323
pub fn venue ( & self ) -> Option < & Venue > {
380
324
match self {
381
325
Self :: Data ( _) => None ,
382
- Self :: Instruments ( cmd) => cmd. venue . as_ref ( ) ,
383
326
Self :: Instrument ( cmd) => Some ( & cmd. instrument_id . venue ) ,
327
+ Self :: Instruments ( cmd) => cmd. venue . as_ref ( ) ,
384
328
Self :: BookSnapshot ( cmd) => Some ( & cmd. instrument_id . venue ) ,
385
329
Self :: Quotes ( cmd) => Some ( & cmd. instrument_id . venue ) ,
386
330
Self :: Trades ( cmd) => Some ( & cmd. instrument_id . venue ) ,
@@ -395,8 +339,8 @@ impl RequestCommand {
395
339
pub fn ts_init ( & self ) -> UnixNanos {
396
340
match self {
397
341
Self :: Data ( cmd) => cmd. ts_init ,
398
- Self :: Instruments ( cmd) => cmd. ts_init ,
399
342
Self :: Instrument ( cmd) => cmd. ts_init ,
343
+ Self :: Instruments ( cmd) => cmd. ts_init ,
400
344
Self :: BookSnapshot ( cmd) => cmd. ts_init ,
401
345
Self :: Quotes ( cmd) => cmd. ts_init ,
402
346
Self :: Trades ( cmd) => cmd. ts_init ,
0 commit comments