1pub const PROTOBUF_MSG_ID: i32 = 200;
3
4#[derive(Debug, Clone, Copy, PartialEq, Eq)]
6#[repr(i32)]
7pub enum Incoming {
8 TickPrice = 1,
10 TickSize = 2,
12 OrderStatus = 3,
14 ErrorMessage = 4,
16 OpenOrder = 5,
18 AccountValue = 6,
20 PortfolioValue = 7,
22 AccountUpdateTime = 8,
24 NextValidId = 9,
26 ContractData = 10,
28 ExecutionData = 11,
30 MarketDepth = 12,
32 MarketDepthL2 = 13,
34 NewsBulletins = 14,
36 ManagedAccounts = 15,
38 ReceiveFa = 16,
40 HistoricalData = 17,
42 BondContractData = 18,
44 ScannerParameters = 19,
46 ScannerData = 20,
48 TickOptionComputation = 21,
50 TickGeneric = 45,
52 TickString = 46,
54 TickEfp = 47,
56 CurrentTime = 49,
58 RealTimeBars = 50,
60 ContractDataEnd = 52,
62 OpenOrderEnd = 53,
64 AccountDownloadEnd = 54,
66 ExecutionDataEnd = 55,
68 DeltaNeutralValidation = 56,
70 TickSnapshotEnd = 57,
72 MarketDataType = 58,
74 CommissionAndFeesReport = 59,
76 PositionData = 61,
78 PositionEnd = 62,
80 AccountSummary = 63,
82 AccountSummaryEnd = 64,
84 VerifyMessageApi = 65,
86 VerifyCompleted = 66,
88 DisplayGroupList = 67,
90 DisplayGroupUpdated = 68,
92 VerifyAndAuthMessageApi = 69,
94 VerifyAndAuthCompleted = 70,
96 PositionMulti = 71,
98 PositionMultiEnd = 72,
100 AccountUpdateMulti = 73,
102 AccountUpdateMultiEnd = 74,
104 SecurityDefinitionOptionParameter = 75,
106 SecurityDefinitionOptionParameterEnd = 76,
108 SoftDollarTiers = 77,
110 FamilyCodes = 78,
112 SymbolSamples = 79,
114 MarketDepthExchanges = 80,
116 TickRequestParameters = 81,
118 SmartComponents = 82,
120 NewsArticle = 83,
122 TickNews = 84,
124 NewsProviders = 85,
126 HistoricalNews = 86,
128 HistoricalNewsEnd = 87,
130 HeadTimestamp = 88,
132 HistogramData = 89,
134 HistoricalDataUpdate = 90,
136 RerouteMarketDataRequest = 91,
138 RerouteMarketDepthRequest = 92,
140 MarketRule = 93,
142 Pnl = 94,
144 PnlSingle = 95,
146 HistoricalTicks = 96,
148 HistoricalTicksBidAsk = 97,
150 HistoricalTicksLast = 98,
152 TickByTick = 99,
154 OrderBound = 100,
156 CompletedOrder = 101,
158 CompletedOrdersEnd = 102,
160 ReplaceFaEnd = 103,
162 WshMetaData = 104,
164 WshEventData = 105,
166 HistoricalSchedule = 106,
168 UserInfo = 107,
170 HistoricalDataEnd = 108,
172 CurrentTimeInMillis = 109,
174 ConfigResponse = 110,
176 UpdateConfigResponse = 111,
178}
179
180impl Incoming {
181 pub const ALL: &'static [Self] = &[
183 Self::TickPrice,
184 Self::TickSize,
185 Self::OrderStatus,
186 Self::ErrorMessage,
187 Self::OpenOrder,
188 Self::AccountValue,
189 Self::PortfolioValue,
190 Self::AccountUpdateTime,
191 Self::NextValidId,
192 Self::ContractData,
193 Self::ExecutionData,
194 Self::MarketDepth,
195 Self::MarketDepthL2,
196 Self::NewsBulletins,
197 Self::ManagedAccounts,
198 Self::ReceiveFa,
199 Self::HistoricalData,
200 Self::BondContractData,
201 Self::ScannerParameters,
202 Self::ScannerData,
203 Self::TickOptionComputation,
204 Self::TickGeneric,
205 Self::TickString,
206 Self::TickEfp,
207 Self::CurrentTime,
208 Self::RealTimeBars,
209 Self::ContractDataEnd,
210 Self::OpenOrderEnd,
211 Self::AccountDownloadEnd,
212 Self::ExecutionDataEnd,
213 Self::DeltaNeutralValidation,
214 Self::TickSnapshotEnd,
215 Self::MarketDataType,
216 Self::CommissionAndFeesReport,
217 Self::PositionData,
218 Self::PositionEnd,
219 Self::AccountSummary,
220 Self::AccountSummaryEnd,
221 Self::VerifyMessageApi,
222 Self::VerifyCompleted,
223 Self::DisplayGroupList,
224 Self::DisplayGroupUpdated,
225 Self::VerifyAndAuthMessageApi,
226 Self::VerifyAndAuthCompleted,
227 Self::PositionMulti,
228 Self::PositionMultiEnd,
229 Self::AccountUpdateMulti,
230 Self::AccountUpdateMultiEnd,
231 Self::SecurityDefinitionOptionParameter,
232 Self::SecurityDefinitionOptionParameterEnd,
233 Self::SoftDollarTiers,
234 Self::FamilyCodes,
235 Self::SymbolSamples,
236 Self::MarketDepthExchanges,
237 Self::TickRequestParameters,
238 Self::SmartComponents,
239 Self::NewsArticle,
240 Self::TickNews,
241 Self::NewsProviders,
242 Self::HistoricalNews,
243 Self::HistoricalNewsEnd,
244 Self::HeadTimestamp,
245 Self::HistogramData,
246 Self::HistoricalDataUpdate,
247 Self::RerouteMarketDataRequest,
248 Self::RerouteMarketDepthRequest,
249 Self::MarketRule,
250 Self::Pnl,
251 Self::PnlSingle,
252 Self::HistoricalTicks,
253 Self::HistoricalTicksBidAsk,
254 Self::HistoricalTicksLast,
255 Self::TickByTick,
256 Self::OrderBound,
257 Self::CompletedOrder,
258 Self::CompletedOrdersEnd,
259 Self::ReplaceFaEnd,
260 Self::WshMetaData,
261 Self::WshEventData,
262 Self::HistoricalSchedule,
263 Self::UserInfo,
264 Self::HistoricalDataEnd,
265 Self::CurrentTimeInMillis,
266 Self::ConfigResponse,
267 Self::UpdateConfigResponse,
268 ];
269}
270
271#[derive(Debug, Clone, Copy, PartialEq, Eq)]
273#[repr(i32)]
274pub enum Outgoing {
275 ReqMktData = 1,
277 CancelMktData = 2,
279 PlaceOrder = 3,
281 CancelOrder = 4,
283 ReqOpenOrders = 5,
285 ReqAcctData = 6,
287 ReqExecutions = 7,
289 ReqIds = 8,
291 ReqContractData = 9,
293 ReqMktDepth = 10,
295 CancelMktDepth = 11,
297 ReqNewsBulletins = 12,
299 CancelNewsBulletins = 13,
301 SetServerLogLevel = 14,
303 ReqAutoOpenOrders = 15,
305 ReqAllOpenOrders = 16,
307 ReqManagedAccounts = 17,
309 ReqFa = 18,
311 ReplaceFa = 19,
313 ReqHistoricalData = 20,
315 ExerciseOptions = 21,
317 ReqScannerSubscription = 22,
319 CancelScannerSubscription = 23,
321 ReqScannerParameters = 24,
323 CancelHistoricalData = 25,
325 ReqCurrentTime = 49,
327 ReqRealTimeBars = 50,
329 CancelRealTimeBars = 51,
331 ReqCalcImpliedVolat = 54,
333 ReqCalcOptionPrice = 55,
335 CancelCalcImpliedVolat = 56,
337 CancelCalcOptionPrice = 57,
339 ReqGlobalCancel = 58,
341 ReqMarketDataType = 59,
343 ReqPositions = 61,
345 ReqAccountSummary = 62,
347 CancelAccountSummary = 63,
349 CancelPositions = 64,
351 VerifyRequest = 65,
353 VerifyMessage = 66,
355 QueryDisplayGroups = 67,
357 SubscribeToGroupEvents = 68,
359 UpdateDisplayGroup = 69,
361 UnsubscribeFromGroupEvents = 70,
363 StartApi = 71,
365 VerifyAndAuthRequest = 72,
367 VerifyAndAuthMessage = 73,
369 ReqPositionsMulti = 74,
371 CancelPositionsMulti = 75,
373 ReqAccountUpdatesMulti = 76,
375 CancelAccountUpdatesMulti = 77,
377 ReqSecDefOptParams = 78,
379 ReqSoftDollarTiers = 79,
381 ReqFamilyCodes = 80,
383 ReqMatchingSymbols = 81,
385 ReqMktDepthExchanges = 82,
387 ReqSmartComponents = 83,
389 ReqNewsArticle = 84,
391 ReqNewsProviders = 85,
393 ReqHistoricalNews = 86,
395 ReqHeadTimestamp = 87,
397 ReqHistogramData = 88,
399 CancelHistogramData = 89,
401 CancelHeadTimestamp = 90,
403 ReqMarketRule = 91,
405 ReqPnl = 92,
407 CancelPnl = 93,
409 ReqPnlSingle = 94,
411 CancelPnlSingle = 95,
413 ReqHistoricalTicks = 96,
415 ReqTickByTickData = 97,
417 CancelTickByTickData = 98,
419 ReqCompletedOrders = 99,
421 ReqWshMetaData = 100,
423 CancelWshMetaData = 101,
425 ReqWshEventData = 102,
427 CancelWshEventData = 103,
429 ReqUserInfo = 104,
431 ReqCurrentTimeInMillis = 105,
433 CancelContractData = 106,
435 CancelHistoricalTicks = 107,
437 ReqConfig = 108,
439 UpdateConfig = 109,
441}
442
443impl Outgoing {
444 pub const fn id(self) -> i32 {
446 self as i32
447 }
448
449 pub const fn protobuf_id(self) -> i32 {
451 self.id() + PROTOBUF_MSG_ID
452 }
453}
454
455impl TryFrom<i32> for Incoming {
456 type Error = ();
457
458 fn try_from(value: i32) -> Result<Self, Self::Error> {
459 Ok(match value {
460 1 => Self::TickPrice,
461 2 => Self::TickSize,
462 3 => Self::OrderStatus,
463 4 => Self::ErrorMessage,
464 5 => Self::OpenOrder,
465 6 => Self::AccountValue,
466 7 => Self::PortfolioValue,
467 8 => Self::AccountUpdateTime,
468 9 => Self::NextValidId,
469 10 => Self::ContractData,
470 11 => Self::ExecutionData,
471 12 => Self::MarketDepth,
472 13 => Self::MarketDepthL2,
473 14 => Self::NewsBulletins,
474 15 => Self::ManagedAccounts,
475 16 => Self::ReceiveFa,
476 17 => Self::HistoricalData,
477 18 => Self::BondContractData,
478 19 => Self::ScannerParameters,
479 20 => Self::ScannerData,
480 21 => Self::TickOptionComputation,
481 45 => Self::TickGeneric,
482 46 => Self::TickString,
483 47 => Self::TickEfp,
484 49 => Self::CurrentTime,
485 50 => Self::RealTimeBars,
486 52 => Self::ContractDataEnd,
487 53 => Self::OpenOrderEnd,
488 54 => Self::AccountDownloadEnd,
489 55 => Self::ExecutionDataEnd,
490 56 => Self::DeltaNeutralValidation,
491 57 => Self::TickSnapshotEnd,
492 58 => Self::MarketDataType,
493 59 => Self::CommissionAndFeesReport,
494 61 => Self::PositionData,
495 62 => Self::PositionEnd,
496 63 => Self::AccountSummary,
497 64 => Self::AccountSummaryEnd,
498 65 => Self::VerifyMessageApi,
499 66 => Self::VerifyCompleted,
500 67 => Self::DisplayGroupList,
501 68 => Self::DisplayGroupUpdated,
502 69 => Self::VerifyAndAuthMessageApi,
503 70 => Self::VerifyAndAuthCompleted,
504 71 => Self::PositionMulti,
505 72 => Self::PositionMultiEnd,
506 73 => Self::AccountUpdateMulti,
507 74 => Self::AccountUpdateMultiEnd,
508 75 => Self::SecurityDefinitionOptionParameter,
509 76 => Self::SecurityDefinitionOptionParameterEnd,
510 77 => Self::SoftDollarTiers,
511 78 => Self::FamilyCodes,
512 79 => Self::SymbolSamples,
513 80 => Self::MarketDepthExchanges,
514 81 => Self::TickRequestParameters,
515 82 => Self::SmartComponents,
516 83 => Self::NewsArticle,
517 84 => Self::TickNews,
518 85 => Self::NewsProviders,
519 86 => Self::HistoricalNews,
520 87 => Self::HistoricalNewsEnd,
521 88 => Self::HeadTimestamp,
522 89 => Self::HistogramData,
523 90 => Self::HistoricalDataUpdate,
524 91 => Self::RerouteMarketDataRequest,
525 92 => Self::RerouteMarketDepthRequest,
526 93 => Self::MarketRule,
527 94 => Self::Pnl,
528 95 => Self::PnlSingle,
529 96 => Self::HistoricalTicks,
530 97 => Self::HistoricalTicksBidAsk,
531 98 => Self::HistoricalTicksLast,
532 99 => Self::TickByTick,
533 100 => Self::OrderBound,
534 101 => Self::CompletedOrder,
535 102 => Self::CompletedOrdersEnd,
536 103 => Self::ReplaceFaEnd,
537 104 => Self::WshMetaData,
538 105 => Self::WshEventData,
539 106 => Self::HistoricalSchedule,
540 107 => Self::UserInfo,
541 108 => Self::HistoricalDataEnd,
542 109 => Self::CurrentTimeInMillis,
543 110 => Self::ConfigResponse,
544 111 => Self::UpdateConfigResponse,
545 _ => return Err(()),
546 })
547 }
548}