Skip to main content

nautilus_binance/spot/sbe/generated/
execution_report_event_codec.rs

1pub use decoder::ExecutionReportEventDecoder;
2pub use encoder::ExecutionReportEventEncoder;
3
4use super::*;
5pub use super::{SBE_SCHEMA_ID, SBE_SCHEMA_VERSION, SBE_SEMANTIC_VERSION};
6
7pub const SBE_BLOCK_LENGTH: u16 = 282;
8pub const SBE_TEMPLATE_ID: u16 = 603;
9
10pub mod encoder {
11    use message_header_codec::*;
12
13    use super::*;
14
15    #[derive(Debug, Default)]
16    pub struct ExecutionReportEventEncoder<'a> {
17        buf: WriteBuf<'a>,
18        initial_offset: usize,
19        offset: usize,
20        limit: usize,
21    }
22
23    impl<'a> Writer<'a> for ExecutionReportEventEncoder<'a> {
24        #[inline]
25        fn get_buf_mut(&mut self) -> &mut WriteBuf<'a> {
26            &mut self.buf
27        }
28    }
29
30    impl<'a> Encoder<'a> for ExecutionReportEventEncoder<'a> {
31        #[inline]
32        fn get_limit(&self) -> usize {
33            self.limit
34        }
35
36        #[inline]
37        fn set_limit(&mut self, limit: usize) {
38            self.limit = limit;
39        }
40    }
41
42    impl<'a> ExecutionReportEventEncoder<'a> {
43        pub fn wrap(mut self, buf: WriteBuf<'a>, offset: usize) -> Self {
44            let limit = offset + SBE_BLOCK_LENGTH as usize;
45            self.buf = buf;
46            self.initial_offset = offset;
47            self.offset = offset;
48            self.limit = limit;
49            self
50        }
51
52        #[inline]
53        pub fn encoded_length(&self) -> usize {
54            self.limit - self.offset
55        }
56
57        pub fn header(self, offset: usize) -> MessageHeaderEncoder<Self> {
58            let mut header = MessageHeaderEncoder::default().wrap(self, offset);
59            header.block_length(SBE_BLOCK_LENGTH);
60            header.template_id(SBE_TEMPLATE_ID);
61            header.schema_id(SBE_SCHEMA_ID);
62            header.version(SBE_SCHEMA_VERSION);
63            header
64        }
65
66        /// primitive field 'eventTime'
67        /// - min value: -9223372036854775807
68        /// - max value: 9223372036854775807
69        /// - null value: -9223372036854775808_i64
70        /// - characterEncoding: null
71        /// - semanticType: null
72        /// - encodedOffset: 0
73        /// - encodedLength: 8
74        /// - version: 0
75        #[inline]
76        pub fn event_time(&mut self, value: i64) {
77            let offset = self.offset;
78            self.get_buf_mut().put_i64_at(offset, value);
79        }
80
81        /// primitive field 'transactTime'
82        /// - min value: -9223372036854775807
83        /// - max value: 9223372036854775807
84        /// - null value: -9223372036854775808_i64
85        /// - characterEncoding: null
86        /// - semanticType: null
87        /// - encodedOffset: 8
88        /// - encodedLength: 8
89        /// - version: 0
90        #[inline]
91        pub fn transact_time(&mut self, value: i64) {
92            let offset = self.offset + 8;
93            self.get_buf_mut().put_i64_at(offset, value);
94        }
95
96        /// primitive field 'priceExponent'
97        /// - min value: -127
98        /// - max value: 127
99        /// - null value: -128_i8
100        /// - characterEncoding: null
101        /// - semanticType: null
102        /// - encodedOffset: 16
103        /// - encodedLength: 1
104        /// - version: 0
105        #[inline]
106        pub fn price_exponent(&mut self, value: i8) {
107            let offset = self.offset + 16;
108            self.get_buf_mut().put_i8_at(offset, value);
109        }
110
111        /// primitive field 'qtyExponent'
112        /// - min value: -127
113        /// - max value: 127
114        /// - null value: -128_i8
115        /// - characterEncoding: null
116        /// - semanticType: null
117        /// - encodedOffset: 17
118        /// - encodedLength: 1
119        /// - version: 0
120        #[inline]
121        pub fn qty_exponent(&mut self, value: i8) {
122            let offset = self.offset + 17;
123            self.get_buf_mut().put_i8_at(offset, value);
124        }
125
126        /// primitive field 'commissionExponent'
127        /// - min value: -127
128        /// - max value: 127
129        /// - null value: -128_i8
130        /// - characterEncoding: null
131        /// - semanticType: null
132        /// - encodedOffset: 18
133        /// - encodedLength: 1
134        /// - version: 0
135        #[inline]
136        pub fn commission_exponent(&mut self, value: i8) {
137            let offset = self.offset + 18;
138            self.get_buf_mut().put_i8_at(offset, value);
139        }
140
141        /// primitive field 'orderCreationTime'
142        /// - min value: -9223372036854775807
143        /// - max value: 9223372036854775807
144        /// - null value: -9223372036854775808_i64
145        /// - characterEncoding: null
146        /// - semanticType: null
147        /// - encodedOffset: 19
148        /// - encodedLength: 8
149        /// - version: 0
150        #[inline]
151        pub fn order_creation_time(&mut self, value: i64) {
152            let offset = self.offset + 19;
153            self.get_buf_mut().put_i64_at(offset, value);
154        }
155
156        /// primitive field 'workingTime'
157        /// - min value: -9223372036854775807
158        /// - max value: 9223372036854775807
159        /// - null value: -9223372036854775808_i64
160        /// - characterEncoding: null
161        /// - semanticType: null
162        /// - encodedOffset: 27
163        /// - encodedLength: 8
164        /// - version: 0
165        #[inline]
166        pub fn working_time(&mut self, value: i64) {
167            let offset = self.offset + 27;
168            self.get_buf_mut().put_i64_at(offset, value);
169        }
170
171        /// primitive field 'orderId'
172        /// - min value: -9223372036854775807
173        /// - max value: 9223372036854775807
174        /// - null value: -9223372036854775808_i64
175        /// - characterEncoding: null
176        /// - semanticType: null
177        /// - encodedOffset: 35
178        /// - encodedLength: 8
179        /// - version: 0
180        #[inline]
181        pub fn order_id(&mut self, value: i64) {
182            let offset = self.offset + 35;
183            self.get_buf_mut().put_i64_at(offset, value);
184        }
185
186        /// primitive field 'orderListId'
187        /// - min value: -9223372036854775807
188        /// - max value: 9223372036854775807
189        /// - null value: -9223372036854775808_i64
190        /// - characterEncoding: null
191        /// - semanticType: null
192        /// - encodedOffset: 43
193        /// - encodedLength: 8
194        /// - version: 0
195        #[inline]
196        pub fn order_list_id(&mut self, value: i64) {
197            let offset = self.offset + 43;
198            self.get_buf_mut().put_i64_at(offset, value);
199        }
200
201        /// primitive field 'origQty'
202        /// - min value: -9223372036854775807
203        /// - max value: 9223372036854775807
204        /// - null value: -9223372036854775808_i64
205        /// - characterEncoding: null
206        /// - semanticType: null
207        /// - encodedOffset: 51
208        /// - encodedLength: 8
209        /// - version: 0
210        #[inline]
211        pub fn orig_qty(&mut self, value: i64) {
212            let offset = self.offset + 51;
213            self.get_buf_mut().put_i64_at(offset, value);
214        }
215
216        /// primitive field 'price'
217        /// - min value: -9223372036854775807
218        /// - max value: 9223372036854775807
219        /// - null value: -9223372036854775808_i64
220        /// - characterEncoding: null
221        /// - semanticType: null
222        /// - encodedOffset: 59
223        /// - encodedLength: 8
224        /// - version: 0
225        #[inline]
226        pub fn price(&mut self, value: i64) {
227            let offset = self.offset + 59;
228            self.get_buf_mut().put_i64_at(offset, value);
229        }
230
231        /// primitive field 'origQuoteOrderQty'
232        /// - min value: -9223372036854775807
233        /// - max value: 9223372036854775807
234        /// - null value: -9223372036854775808_i64
235        /// - characterEncoding: null
236        /// - semanticType: null
237        /// - encodedOffset: 67
238        /// - encodedLength: 8
239        /// - version: 0
240        #[inline]
241        pub fn orig_quote_order_qty(&mut self, value: i64) {
242            let offset = self.offset + 67;
243            self.get_buf_mut().put_i64_at(offset, value);
244        }
245
246        /// primitive field 'icebergQty'
247        /// - min value: -9223372036854775807
248        /// - max value: 9223372036854775807
249        /// - null value: -9223372036854775808_i64
250        /// - characterEncoding: null
251        /// - semanticType: null
252        /// - encodedOffset: 75
253        /// - encodedLength: 8
254        /// - version: 0
255        #[inline]
256        pub fn iceberg_qty(&mut self, value: i64) {
257            let offset = self.offset + 75;
258            self.get_buf_mut().put_i64_at(offset, value);
259        }
260
261        /// primitive field 'stopPrice'
262        /// - min value: -9223372036854775807
263        /// - max value: 9223372036854775807
264        /// - null value: -9223372036854775808_i64
265        /// - characterEncoding: null
266        /// - semanticType: null
267        /// - encodedOffset: 83
268        /// - encodedLength: 8
269        /// - version: 0
270        #[inline]
271        pub fn stop_price(&mut self, value: i64) {
272            let offset = self.offset + 83;
273            self.get_buf_mut().put_i64_at(offset, value);
274        }
275
276        /// REQUIRED enum
277        #[inline]
278        pub fn order_type(&mut self, value: order_type::OrderType) {
279            let offset = self.offset + 91;
280            self.get_buf_mut().put_u8_at(offset, value as u8)
281        }
282
283        /// REQUIRED enum
284        #[inline]
285        pub fn side(&mut self, value: order_side::OrderSide) {
286            let offset = self.offset + 92;
287            self.get_buf_mut().put_u8_at(offset, value as u8)
288        }
289
290        /// REQUIRED enum
291        #[inline]
292        pub fn time_in_force(&mut self, value: time_in_force::TimeInForce) {
293            let offset = self.offset + 93;
294            self.get_buf_mut().put_u8_at(offset, value as u8)
295        }
296
297        /// REQUIRED enum
298        #[inline]
299        pub fn execution_type(&mut self, value: execution_type::ExecutionType) {
300            let offset = self.offset + 94;
301            self.get_buf_mut().put_u8_at(offset, value as u8)
302        }
303
304        /// REQUIRED enum
305        #[inline]
306        pub fn order_status(&mut self, value: order_status::OrderStatus) {
307            let offset = self.offset + 95;
308            self.get_buf_mut().put_u8_at(offset, value as u8)
309        }
310
311        /// primitive field 'tradeId'
312        /// - min value: -9223372036854775807
313        /// - max value: 9223372036854775807
314        /// - null value: -9223372036854775808_i64
315        /// - characterEncoding: null
316        /// - semanticType: null
317        /// - encodedOffset: 96
318        /// - encodedLength: 8
319        /// - version: 0
320        #[inline]
321        pub fn trade_id(&mut self, value: i64) {
322            let offset = self.offset + 96;
323            self.get_buf_mut().put_i64_at(offset, value);
324        }
325
326        /// primitive field 'executionId'
327        /// - min value: -9223372036854775807
328        /// - max value: 9223372036854775807
329        /// - null value: -9223372036854775808_i64
330        /// - characterEncoding: null
331        /// - semanticType: null
332        /// - encodedOffset: 104
333        /// - encodedLength: 8
334        /// - version: 0
335        #[inline]
336        pub fn execution_id(&mut self, value: i64) {
337            let offset = self.offset + 104;
338            self.get_buf_mut().put_i64_at(offset, value);
339        }
340
341        /// primitive field 'executedQty'
342        /// - min value: -9223372036854775807
343        /// - max value: 9223372036854775807
344        /// - null value: -9223372036854775808_i64
345        /// - characterEncoding: null
346        /// - semanticType: null
347        /// - encodedOffset: 112
348        /// - encodedLength: 8
349        /// - version: 0
350        #[inline]
351        pub fn executed_qty(&mut self, value: i64) {
352            let offset = self.offset + 112;
353            self.get_buf_mut().put_i64_at(offset, value);
354        }
355
356        /// primitive field 'cummulativeQuoteQty'
357        /// - min value: -9223372036854775807
358        /// - max value: 9223372036854775807
359        /// - null value: -9223372036854775808_i64
360        /// - characterEncoding: null
361        /// - semanticType: null
362        /// - encodedOffset: 120
363        /// - encodedLength: 8
364        /// - version: 0
365        #[inline]
366        pub fn cummulative_quote_qty(&mut self, value: i64) {
367            let offset = self.offset + 120;
368            self.get_buf_mut().put_i64_at(offset, value);
369        }
370
371        /// primitive field 'lastQty'
372        /// - min value: -9223372036854775807
373        /// - max value: 9223372036854775807
374        /// - null value: -9223372036854775808_i64
375        /// - characterEncoding: null
376        /// - semanticType: null
377        /// - encodedOffset: 128
378        /// - encodedLength: 8
379        /// - version: 0
380        #[inline]
381        pub fn last_qty(&mut self, value: i64) {
382            let offset = self.offset + 128;
383            self.get_buf_mut().put_i64_at(offset, value);
384        }
385
386        /// primitive field 'lastPrice'
387        /// - min value: -9223372036854775807
388        /// - max value: 9223372036854775807
389        /// - null value: -9223372036854775808_i64
390        /// - characterEncoding: null
391        /// - semanticType: null
392        /// - encodedOffset: 136
393        /// - encodedLength: 8
394        /// - version: 0
395        #[inline]
396        pub fn last_price(&mut self, value: i64) {
397            let offset = self.offset + 136;
398            self.get_buf_mut().put_i64_at(offset, value);
399        }
400
401        /// primitive field 'quoteQty'
402        /// - min value: -9223372036854775807
403        /// - max value: 9223372036854775807
404        /// - null value: -9223372036854775808_i64
405        /// - characterEncoding: null
406        /// - semanticType: null
407        /// - encodedOffset: 144
408        /// - encodedLength: 8
409        /// - version: 0
410        #[inline]
411        pub fn quote_qty(&mut self, value: i64) {
412            let offset = self.offset + 144;
413            self.get_buf_mut().put_i64_at(offset, value);
414        }
415
416        /// primitive field 'commission'
417        /// - min value: -9223372036854775807
418        /// - max value: 9223372036854775807
419        /// - null value: -9223372036854775808_i64
420        /// - characterEncoding: null
421        /// - semanticType: null
422        /// - encodedOffset: 152
423        /// - encodedLength: 8
424        /// - version: 0
425        #[inline]
426        pub fn commission(&mut self, value: i64) {
427            let offset = self.offset + 152;
428            self.get_buf_mut().put_i64_at(offset, value);
429        }
430
431        /// REQUIRED enum
432        #[inline]
433        pub fn is_working(&mut self, value: bool_enum::BoolEnum) {
434            let offset = self.offset + 160;
435            self.get_buf_mut().put_u8_at(offset, value as u8)
436        }
437
438        /// REQUIRED enum
439        #[inline]
440        pub fn is_maker(&mut self, value: bool_enum::BoolEnum) {
441            let offset = self.offset + 161;
442            self.get_buf_mut().put_u8_at(offset, value as u8)
443        }
444
445        /// REQUIRED enum
446        #[inline]
447        pub fn is_best_match(&mut self, value: bool_enum::BoolEnum) {
448            let offset = self.offset + 162;
449            self.get_buf_mut().put_u8_at(offset, value as u8)
450        }
451
452        /// REQUIRED enum
453        #[inline]
454        pub fn match_type(&mut self, value: match_type::MatchType) {
455            let offset = self.offset + 163;
456            self.get_buf_mut().put_u8_at(offset, value as u8)
457        }
458
459        /// REQUIRED enum
460        #[inline]
461        pub fn self_trade_prevention_mode(
462            &mut self,
463            value: self_trade_prevention_mode::SelfTradePreventionMode,
464        ) {
465            let offset = self.offset + 164;
466            self.get_buf_mut().put_u8_at(offset, value as u8)
467        }
468
469        /// REQUIRED enum
470        #[inline]
471        pub fn order_capacity(&mut self, value: order_capacity::OrderCapacity) {
472            let offset = self.offset + 165;
473            self.get_buf_mut().put_u8_at(offset, value as u8)
474        }
475
476        /// REQUIRED enum
477        #[inline]
478        pub fn working_floor(&mut self, value: floor::Floor) {
479            let offset = self.offset + 166;
480            self.get_buf_mut().put_u8_at(offset, value as u8)
481        }
482
483        /// REQUIRED enum
484        #[inline]
485        pub fn used_sor(&mut self, value: bool_enum::BoolEnum) {
486            let offset = self.offset + 167;
487            self.get_buf_mut().put_u8_at(offset, value as u8)
488        }
489
490        /// primitive field 'allocId'
491        /// - min value: -9223372036854775807
492        /// - max value: 9223372036854775807
493        /// - null value: -9223372036854775808_i64
494        /// - characterEncoding: null
495        /// - semanticType: null
496        /// - encodedOffset: 168
497        /// - encodedLength: 8
498        /// - version: 0
499        #[inline]
500        pub fn alloc_id(&mut self, value: i64) {
501            let offset = self.offset + 168;
502            self.get_buf_mut().put_i64_at(offset, value);
503        }
504
505        /// primitive field 'trailingDelta'
506        /// - min value: 0
507        /// - max value: -2
508        /// - null value: 0xffffffffffffffff_u64
509        /// - characterEncoding: null
510        /// - semanticType: null
511        /// - encodedOffset: 176
512        /// - encodedLength: 8
513        /// - version: 0
514        #[inline]
515        pub fn trailing_delta(&mut self, value: u64) {
516            let offset = self.offset + 176;
517            self.get_buf_mut().put_u64_at(offset, value);
518        }
519
520        /// primitive field 'trailingTime'
521        /// - min value: -9223372036854775807
522        /// - max value: 9223372036854775807
523        /// - null value: -9223372036854775808_i64
524        /// - characterEncoding: null
525        /// - semanticType: null
526        /// - encodedOffset: 184
527        /// - encodedLength: 8
528        /// - version: 0
529        #[inline]
530        pub fn trailing_time(&mut self, value: i64) {
531            let offset = self.offset + 184;
532            self.get_buf_mut().put_i64_at(offset, value);
533        }
534
535        /// primitive field 'tradeGroupId'
536        /// - min value: -9223372036854775807
537        /// - max value: 9223372036854775807
538        /// - null value: -9223372036854775808_i64
539        /// - characterEncoding: null
540        /// - semanticType: null
541        /// - encodedOffset: 192
542        /// - encodedLength: 8
543        /// - version: 0
544        #[inline]
545        pub fn trade_group_id(&mut self, value: i64) {
546            let offset = self.offset + 192;
547            self.get_buf_mut().put_i64_at(offset, value);
548        }
549
550        /// primitive field 'preventedQty'
551        /// - min value: -9223372036854775807
552        /// - max value: 9223372036854775807
553        /// - null value: -9223372036854775808_i64
554        /// - characterEncoding: null
555        /// - semanticType: null
556        /// - encodedOffset: 200
557        /// - encodedLength: 8
558        /// - version: 0
559        #[inline]
560        pub fn prevented_qty(&mut self, value: i64) {
561            let offset = self.offset + 200;
562            self.get_buf_mut().put_i64_at(offset, value);
563        }
564
565        /// primitive field 'lastPreventedQty'
566        /// - min value: -9223372036854775807
567        /// - max value: 9223372036854775807
568        /// - null value: -9223372036854775808_i64
569        /// - characterEncoding: null
570        /// - semanticType: null
571        /// - encodedOffset: 208
572        /// - encodedLength: 8
573        /// - version: 0
574        #[inline]
575        pub fn last_prevented_qty(&mut self, value: i64) {
576            let offset = self.offset + 208;
577            self.get_buf_mut().put_i64_at(offset, value);
578        }
579
580        /// primitive field 'preventedMatchId'
581        /// - min value: -9223372036854775807
582        /// - max value: 9223372036854775807
583        /// - null value: -9223372036854775808_i64
584        /// - characterEncoding: null
585        /// - semanticType: null
586        /// - encodedOffset: 216
587        /// - encodedLength: 8
588        /// - version: 0
589        #[inline]
590        pub fn prevented_match_id(&mut self, value: i64) {
591            let offset = self.offset + 216;
592            self.get_buf_mut().put_i64_at(offset, value);
593        }
594
595        /// primitive field 'preventedExecutionQty'
596        /// - min value: -9223372036854775807
597        /// - max value: 9223372036854775807
598        /// - null value: -9223372036854775808_i64
599        /// - characterEncoding: null
600        /// - semanticType: null
601        /// - encodedOffset: 224
602        /// - encodedLength: 8
603        /// - version: 0
604        #[inline]
605        pub fn prevented_execution_qty(&mut self, value: i64) {
606            let offset = self.offset + 224;
607            self.get_buf_mut().put_i64_at(offset, value);
608        }
609
610        /// primitive field 'preventedExecutionPrice'
611        /// - min value: -9223372036854775807
612        /// - max value: 9223372036854775807
613        /// - null value: -9223372036854775808_i64
614        /// - characterEncoding: null
615        /// - semanticType: null
616        /// - encodedOffset: 232
617        /// - encodedLength: 8
618        /// - version: 0
619        #[inline]
620        pub fn prevented_execution_price(&mut self, value: i64) {
621            let offset = self.offset + 232;
622            self.get_buf_mut().put_i64_at(offset, value);
623        }
624
625        /// primitive field 'preventedExecutionQuoteQty'
626        /// - min value: -9223372036854775807
627        /// - max value: 9223372036854775807
628        /// - null value: -9223372036854775808_i64
629        /// - characterEncoding: null
630        /// - semanticType: null
631        /// - encodedOffset: 240
632        /// - encodedLength: 8
633        /// - version: 0
634        #[inline]
635        pub fn prevented_execution_quote_qty(&mut self, value: i64) {
636            let offset = self.offset + 240;
637            self.get_buf_mut().put_i64_at(offset, value);
638        }
639
640        /// primitive field 'strategyType'
641        /// - min value: -2147483647
642        /// - max value: 2147483647
643        /// - null value: -2147483648_i32
644        /// - characterEncoding: null
645        /// - semanticType: null
646        /// - encodedOffset: 248
647        /// - encodedLength: 4
648        /// - version: 0
649        #[inline]
650        pub fn strategy_type(&mut self, value: i32) {
651            let offset = self.offset + 248;
652            self.get_buf_mut().put_i32_at(offset, value);
653        }
654
655        /// primitive field 'strategyId'
656        /// - min value: -9223372036854775807
657        /// - max value: 9223372036854775807
658        /// - null value: -9223372036854775808_i64
659        /// - characterEncoding: null
660        /// - semanticType: null
661        /// - encodedOffset: 252
662        /// - encodedLength: 8
663        /// - version: 0
664        #[inline]
665        pub fn strategy_id(&mut self, value: i64) {
666            let offset = self.offset + 252;
667            self.get_buf_mut().put_i64_at(offset, value);
668        }
669
670        /// primitive field 'counterOrderId'
671        /// - min value: -9223372036854775807
672        /// - max value: 9223372036854775807
673        /// - null value: -9223372036854775808_i64
674        /// - characterEncoding: null
675        /// - semanticType: null
676        /// - encodedOffset: 260
677        /// - encodedLength: 8
678        /// - version: 0
679        #[inline]
680        pub fn counter_order_id(&mut self, value: i64) {
681            let offset = self.offset + 260;
682            self.get_buf_mut().put_i64_at(offset, value);
683        }
684
685        /// primitive field 'subscriptionId'
686        /// - min value: 0
687        /// - max value: 65534
688        /// - null value: 0xffff_u16
689        /// - characterEncoding: null
690        /// - semanticType: null
691        /// - encodedOffset: 268
692        /// - encodedLength: 2
693        /// - version: 1
694        #[inline]
695        pub fn subscription_id(&mut self, value: u16) {
696            let offset = self.offset + 268;
697            self.get_buf_mut().put_u16_at(offset, value);
698        }
699
700        /// REQUIRED enum
701        #[inline]
702        pub fn peg_price_type(&mut self, value: peg_price_type::PegPriceType) {
703            let offset = self.offset + 270;
704            self.get_buf_mut().put_u8_at(offset, value as u8)
705        }
706
707        /// REQUIRED enum
708        #[inline]
709        pub fn peg_offset_type(&mut self, value: peg_offset_type::PegOffsetType) {
710            let offset = self.offset + 271;
711            self.get_buf_mut().put_u8_at(offset, value as u8)
712        }
713
714        /// primitive field 'pegOffsetValue'
715        /// - min value: 0
716        /// - max value: 254
717        /// - null value: 0xff_u8
718        /// - characterEncoding: null
719        /// - semanticType: null
720        /// - encodedOffset: 272
721        /// - encodedLength: 1
722        /// - version: 1
723        #[inline]
724        pub fn peg_offset_value(&mut self, value: u8) {
725            let offset = self.offset + 272;
726            self.get_buf_mut().put_u8_at(offset, value);
727        }
728
729        /// primitive field 'peggedPrice'
730        /// - min value: -9223372036854775807
731        /// - max value: 9223372036854775807
732        /// - null value: -9223372036854775808_i64
733        /// - characterEncoding: null
734        /// - semanticType: null
735        /// - encodedOffset: 273
736        /// - encodedLength: 8
737        /// - version: 1
738        #[inline]
739        pub fn pegged_price(&mut self, value: i64) {
740            let offset = self.offset + 273;
741            self.get_buf_mut().put_i64_at(offset, value);
742        }
743
744        /// REQUIRED enum
745        #[inline]
746        pub fn expiry_reason(&mut self, value: expiry_reason::ExpiryReason) {
747            let offset = self.offset + 281;
748            self.get_buf_mut().put_u8_at(offset, value as u8)
749        }
750
751        /// VAR_DATA ENCODER - character encoding: 'UTF-8'
752        #[inline]
753        pub fn symbol(&mut self, value: &str) {
754            let limit = self.get_limit();
755            let data_length = value.len();
756            self.set_limit(limit + 1 + data_length);
757            self.get_buf_mut().put_u8_at(limit, data_length as u8);
758            self.get_buf_mut().put_slice_at(limit + 1, value.as_bytes());
759        }
760
761        /// VAR_DATA ENCODER - character encoding: 'UTF-8'
762        #[inline]
763        pub fn client_order_id(&mut self, value: &str) {
764            let limit = self.get_limit();
765            let data_length = value.len();
766            self.set_limit(limit + 1 + data_length);
767            self.get_buf_mut().put_u8_at(limit, data_length as u8);
768            self.get_buf_mut().put_slice_at(limit + 1, value.as_bytes());
769        }
770
771        /// VAR_DATA ENCODER - character encoding: 'UTF-8'
772        #[inline]
773        pub fn orig_client_order_id(&mut self, value: &str) {
774            let limit = self.get_limit();
775            let data_length = value.len();
776            self.set_limit(limit + 1 + data_length);
777            self.get_buf_mut().put_u8_at(limit, data_length as u8);
778            self.get_buf_mut().put_slice_at(limit + 1, value.as_bytes());
779        }
780
781        /// VAR_DATA ENCODER - character encoding: 'UTF-8'
782        #[inline]
783        pub fn commission_asset(&mut self, value: &str) {
784            let limit = self.get_limit();
785            let data_length = value.len();
786            self.set_limit(limit + 1 + data_length);
787            self.get_buf_mut().put_u8_at(limit, data_length as u8);
788            self.get_buf_mut().put_slice_at(limit + 1, value.as_bytes());
789        }
790
791        /// VAR_DATA ENCODER - character encoding: 'UTF-8'
792        #[inline]
793        pub fn reject_reason(&mut self, value: &str) {
794            let limit = self.get_limit();
795            let data_length = value.len();
796            self.set_limit(limit + 1 + data_length);
797            self.get_buf_mut().put_u8_at(limit, data_length as u8);
798            self.get_buf_mut().put_slice_at(limit + 1, value.as_bytes());
799        }
800
801        /// VAR_DATA ENCODER - character encoding: 'UTF-8'
802        #[inline]
803        pub fn counter_symbol(&mut self, value: &str) {
804            let limit = self.get_limit();
805            let data_length = value.len();
806            self.set_limit(limit + 1 + data_length);
807            self.get_buf_mut().put_u8_at(limit, data_length as u8);
808            self.get_buf_mut().put_slice_at(limit + 1, value.as_bytes());
809        }
810    }
811} // end encoder
812
813pub mod decoder {
814    use message_header_codec::*;
815
816    use super::*;
817
818    #[derive(Clone, Copy, Debug, Default)]
819    pub struct ExecutionReportEventDecoder<'a> {
820        buf: ReadBuf<'a>,
821        initial_offset: usize,
822        offset: usize,
823        limit: usize,
824        pub acting_block_length: u16,
825        pub acting_version: u16,
826    }
827
828    impl ActingVersion for ExecutionReportEventDecoder<'_> {
829        #[inline]
830        fn acting_version(&self) -> u16 {
831            self.acting_version
832        }
833    }
834
835    impl<'a> Reader<'a> for ExecutionReportEventDecoder<'a> {
836        #[inline]
837        fn get_buf(&self) -> &ReadBuf<'a> {
838            &self.buf
839        }
840    }
841
842    impl<'a> Decoder<'a> for ExecutionReportEventDecoder<'a> {
843        #[inline]
844        fn get_limit(&self) -> usize {
845            self.limit
846        }
847
848        #[inline]
849        fn set_limit(&mut self, limit: usize) {
850            self.limit = limit;
851        }
852    }
853
854    impl<'a> ExecutionReportEventDecoder<'a> {
855        pub fn wrap(
856            mut self,
857            buf: ReadBuf<'a>,
858            offset: usize,
859            acting_block_length: u16,
860            acting_version: u16,
861        ) -> Self {
862            let limit = offset + acting_block_length as usize;
863            self.buf = buf;
864            self.initial_offset = offset;
865            self.offset = offset;
866            self.limit = limit;
867            self.acting_block_length = acting_block_length;
868            self.acting_version = acting_version;
869            self
870        }
871
872        #[inline]
873        pub fn encoded_length(&self) -> usize {
874            self.limit - self.offset
875        }
876
877        pub fn header(self, mut header: MessageHeaderDecoder<ReadBuf<'a>>, offset: usize) -> Self {
878            debug_assert_eq!(SBE_TEMPLATE_ID, header.template_id());
879            let acting_block_length = header.block_length();
880            let acting_version = header.version();
881
882            self.wrap(
883                header.parent().unwrap(),
884                offset + message_header_codec::ENCODED_LENGTH,
885                acting_block_length,
886                acting_version,
887            )
888        }
889
890        /// primitive field - 'REQUIRED'
891        #[inline]
892        pub fn event_time(&self) -> i64 {
893            self.get_buf().get_i64_at(self.offset)
894        }
895
896        /// primitive field - 'REQUIRED'
897        #[inline]
898        pub fn transact_time(&self) -> i64 {
899            self.get_buf().get_i64_at(self.offset + 8)
900        }
901
902        /// primitive field - 'REQUIRED'
903        #[inline]
904        pub fn price_exponent(&self) -> i8 {
905            self.get_buf().get_i8_at(self.offset + 16)
906        }
907
908        /// primitive field - 'REQUIRED'
909        #[inline]
910        pub fn qty_exponent(&self) -> i8 {
911            self.get_buf().get_i8_at(self.offset + 17)
912        }
913
914        /// primitive field - 'REQUIRED'
915        #[inline]
916        pub fn commission_exponent(&self) -> i8 {
917            self.get_buf().get_i8_at(self.offset + 18)
918        }
919
920        /// primitive field - 'OPTIONAL' { null_value: '-9223372036854775808_i64' }
921        #[inline]
922        pub fn order_creation_time(&self) -> Option<i64> {
923            let value = self.get_buf().get_i64_at(self.offset + 19);
924            if value == -9223372036854775808_i64 {
925                None
926            } else {
927                Some(value)
928            }
929        }
930
931        /// primitive field - 'OPTIONAL' { null_value: '-9223372036854775808_i64' }
932        #[inline]
933        pub fn working_time(&self) -> Option<i64> {
934            let value = self.get_buf().get_i64_at(self.offset + 27);
935            if value == -9223372036854775808_i64 {
936                None
937            } else {
938                Some(value)
939            }
940        }
941
942        /// primitive field - 'REQUIRED'
943        #[inline]
944        pub fn order_id(&self) -> i64 {
945            self.get_buf().get_i64_at(self.offset + 35)
946        }
947
948        /// primitive field - 'OPTIONAL' { null_value: '-9223372036854775808_i64' }
949        #[inline]
950        pub fn order_list_id(&self) -> Option<i64> {
951            let value = self.get_buf().get_i64_at(self.offset + 43);
952            if value == -9223372036854775808_i64 {
953                None
954            } else {
955                Some(value)
956            }
957        }
958
959        /// primitive field - 'REQUIRED'
960        #[inline]
961        pub fn orig_qty(&self) -> i64 {
962            self.get_buf().get_i64_at(self.offset + 51)
963        }
964
965        /// primitive field - 'REQUIRED'
966        #[inline]
967        pub fn price(&self) -> i64 {
968            self.get_buf().get_i64_at(self.offset + 59)
969        }
970
971        /// primitive field - 'REQUIRED'
972        #[inline]
973        pub fn orig_quote_order_qty(&self) -> i64 {
974            self.get_buf().get_i64_at(self.offset + 67)
975        }
976
977        /// primitive field - 'REQUIRED'
978        #[inline]
979        pub fn iceberg_qty(&self) -> i64 {
980            self.get_buf().get_i64_at(self.offset + 75)
981        }
982
983        /// primitive field - 'REQUIRED'
984        #[inline]
985        pub fn stop_price(&self) -> i64 {
986            self.get_buf().get_i64_at(self.offset + 83)
987        }
988
989        /// REQUIRED enum
990        #[inline]
991        pub fn order_type(&self) -> order_type::OrderType {
992            self.get_buf().get_u8_at(self.offset + 91).into()
993        }
994
995        /// REQUIRED enum
996        #[inline]
997        pub fn side(&self) -> order_side::OrderSide {
998            self.get_buf().get_u8_at(self.offset + 92).into()
999        }
1000
1001        /// REQUIRED enum
1002        #[inline]
1003        pub fn time_in_force(&self) -> time_in_force::TimeInForce {
1004            self.get_buf().get_u8_at(self.offset + 93).into()
1005        }
1006
1007        /// REQUIRED enum
1008        #[inline]
1009        pub fn execution_type(&self) -> execution_type::ExecutionType {
1010            self.get_buf().get_u8_at(self.offset + 94).into()
1011        }
1012
1013        /// REQUIRED enum
1014        #[inline]
1015        pub fn order_status(&self) -> order_status::OrderStatus {
1016            self.get_buf().get_u8_at(self.offset + 95).into()
1017        }
1018
1019        /// primitive field - 'OPTIONAL' { null_value: '-9223372036854775808_i64' }
1020        #[inline]
1021        pub fn trade_id(&self) -> Option<i64> {
1022            let value = self.get_buf().get_i64_at(self.offset + 96);
1023            if value == -9223372036854775808_i64 {
1024                None
1025            } else {
1026                Some(value)
1027            }
1028        }
1029
1030        /// primitive field - 'REQUIRED'
1031        #[inline]
1032        pub fn execution_id(&self) -> i64 {
1033            self.get_buf().get_i64_at(self.offset + 104)
1034        }
1035
1036        /// primitive field - 'REQUIRED'
1037        #[inline]
1038        pub fn executed_qty(&self) -> i64 {
1039            self.get_buf().get_i64_at(self.offset + 112)
1040        }
1041
1042        /// primitive field - 'REQUIRED'
1043        #[inline]
1044        pub fn cummulative_quote_qty(&self) -> i64 {
1045            self.get_buf().get_i64_at(self.offset + 120)
1046        }
1047
1048        /// primitive field - 'REQUIRED'
1049        #[inline]
1050        pub fn last_qty(&self) -> i64 {
1051            self.get_buf().get_i64_at(self.offset + 128)
1052        }
1053
1054        /// primitive field - 'REQUIRED'
1055        #[inline]
1056        pub fn last_price(&self) -> i64 {
1057            self.get_buf().get_i64_at(self.offset + 136)
1058        }
1059
1060        /// primitive field - 'REQUIRED'
1061        #[inline]
1062        pub fn quote_qty(&self) -> i64 {
1063            self.get_buf().get_i64_at(self.offset + 144)
1064        }
1065
1066        /// primitive field - 'REQUIRED'
1067        #[inline]
1068        pub fn commission(&self) -> i64 {
1069            self.get_buf().get_i64_at(self.offset + 152)
1070        }
1071
1072        /// REQUIRED enum
1073        #[inline]
1074        pub fn is_working(&self) -> bool_enum::BoolEnum {
1075            self.get_buf().get_u8_at(self.offset + 160).into()
1076        }
1077
1078        /// REQUIRED enum
1079        #[inline]
1080        pub fn is_maker(&self) -> bool_enum::BoolEnum {
1081            self.get_buf().get_u8_at(self.offset + 161).into()
1082        }
1083
1084        /// REQUIRED enum
1085        #[inline]
1086        pub fn is_best_match(&self) -> bool_enum::BoolEnum {
1087            self.get_buf().get_u8_at(self.offset + 162).into()
1088        }
1089
1090        /// REQUIRED enum
1091        #[inline]
1092        pub fn match_type(&self) -> match_type::MatchType {
1093            self.get_buf().get_u8_at(self.offset + 163).into()
1094        }
1095
1096        /// REQUIRED enum
1097        #[inline]
1098        pub fn self_trade_prevention_mode(
1099            &self,
1100        ) -> self_trade_prevention_mode::SelfTradePreventionMode {
1101            self.get_buf().get_u8_at(self.offset + 164).into()
1102        }
1103
1104        /// REQUIRED enum
1105        #[inline]
1106        pub fn order_capacity(&self) -> order_capacity::OrderCapacity {
1107            self.get_buf().get_u8_at(self.offset + 165).into()
1108        }
1109
1110        /// REQUIRED enum
1111        #[inline]
1112        pub fn working_floor(&self) -> floor::Floor {
1113            self.get_buf().get_u8_at(self.offset + 166).into()
1114        }
1115
1116        /// REQUIRED enum
1117        #[inline]
1118        pub fn used_sor(&self) -> bool_enum::BoolEnum {
1119            self.get_buf().get_u8_at(self.offset + 167).into()
1120        }
1121
1122        /// primitive field - 'OPTIONAL' { null_value: '-9223372036854775808_i64' }
1123        #[inline]
1124        pub fn alloc_id(&self) -> Option<i64> {
1125            let value = self.get_buf().get_i64_at(self.offset + 168);
1126            if value == -9223372036854775808_i64 {
1127                None
1128            } else {
1129                Some(value)
1130            }
1131        }
1132
1133        /// primitive field - 'OPTIONAL' { null_value: '0xffffffffffffffff_u64' }
1134        #[inline]
1135        pub fn trailing_delta(&self) -> Option<u64> {
1136            let value = self.get_buf().get_u64_at(self.offset + 176);
1137            if value == 0xffffffffffffffff_u64 {
1138                None
1139            } else {
1140                Some(value)
1141            }
1142        }
1143
1144        /// primitive field - 'OPTIONAL' { null_value: '-9223372036854775808_i64' }
1145        #[inline]
1146        pub fn trailing_time(&self) -> Option<i64> {
1147            let value = self.get_buf().get_i64_at(self.offset + 184);
1148            if value == -9223372036854775808_i64 {
1149                None
1150            } else {
1151                Some(value)
1152            }
1153        }
1154
1155        /// primitive field - 'OPTIONAL' { null_value: '-9223372036854775808_i64' }
1156        #[inline]
1157        pub fn trade_group_id(&self) -> Option<i64> {
1158            let value = self.get_buf().get_i64_at(self.offset + 192);
1159            if value == -9223372036854775808_i64 {
1160                None
1161            } else {
1162                Some(value)
1163            }
1164        }
1165
1166        /// primitive field - 'REQUIRED'
1167        #[inline]
1168        pub fn prevented_qty(&self) -> i64 {
1169            self.get_buf().get_i64_at(self.offset + 200)
1170        }
1171
1172        /// primitive field - 'OPTIONAL' { null_value: '-9223372036854775808_i64' }
1173        #[inline]
1174        pub fn last_prevented_qty(&self) -> Option<i64> {
1175            let value = self.get_buf().get_i64_at(self.offset + 208);
1176            if value == -9223372036854775808_i64 {
1177                None
1178            } else {
1179                Some(value)
1180            }
1181        }
1182
1183        /// primitive field - 'OPTIONAL' { null_value: '-9223372036854775808_i64' }
1184        #[inline]
1185        pub fn prevented_match_id(&self) -> Option<i64> {
1186            let value = self.get_buf().get_i64_at(self.offset + 216);
1187            if value == -9223372036854775808_i64 {
1188                None
1189            } else {
1190                Some(value)
1191            }
1192        }
1193
1194        /// primitive field - 'OPTIONAL' { null_value: '-9223372036854775808_i64' }
1195        #[inline]
1196        pub fn prevented_execution_qty(&self) -> Option<i64> {
1197            let value = self.get_buf().get_i64_at(self.offset + 224);
1198            if value == -9223372036854775808_i64 {
1199                None
1200            } else {
1201                Some(value)
1202            }
1203        }
1204
1205        /// primitive field - 'OPTIONAL' { null_value: '-9223372036854775808_i64' }
1206        #[inline]
1207        pub fn prevented_execution_price(&self) -> Option<i64> {
1208            let value = self.get_buf().get_i64_at(self.offset + 232);
1209            if value == -9223372036854775808_i64 {
1210                None
1211            } else {
1212                Some(value)
1213            }
1214        }
1215
1216        /// primitive field - 'OPTIONAL' { null_value: '-9223372036854775808_i64' }
1217        #[inline]
1218        pub fn prevented_execution_quote_qty(&self) -> Option<i64> {
1219            let value = self.get_buf().get_i64_at(self.offset + 240);
1220            if value == -9223372036854775808_i64 {
1221                None
1222            } else {
1223                Some(value)
1224            }
1225        }
1226
1227        /// primitive field - 'OPTIONAL' { null_value: '-2147483648_i32' }
1228        #[inline]
1229        pub fn strategy_type(&self) -> Option<i32> {
1230            let value = self.get_buf().get_i32_at(self.offset + 248);
1231            if value == -2147483648_i32 {
1232                None
1233            } else {
1234                Some(value)
1235            }
1236        }
1237
1238        /// primitive field - 'OPTIONAL' { null_value: '-9223372036854775808_i64' }
1239        #[inline]
1240        pub fn strategy_id(&self) -> Option<i64> {
1241            let value = self.get_buf().get_i64_at(self.offset + 252);
1242            if value == -9223372036854775808_i64 {
1243                None
1244            } else {
1245                Some(value)
1246            }
1247        }
1248
1249        /// primitive field - 'OPTIONAL' { null_value: '-9223372036854775808_i64' }
1250        #[inline]
1251        pub fn counter_order_id(&self) -> Option<i64> {
1252            let value = self.get_buf().get_i64_at(self.offset + 260);
1253            if value == -9223372036854775808_i64 {
1254                None
1255            } else {
1256                Some(value)
1257            }
1258        }
1259
1260        /// primitive field - 'OPTIONAL' { null_value: '0xffff_u16' }
1261        #[inline]
1262        pub fn subscription_id(&self) -> Option<u16> {
1263            if self.acting_version() < 1 {
1264                return None;
1265            }
1266
1267            let value = self.get_buf().get_u16_at(self.offset + 268);
1268            if value == 0xffff_u16 {
1269                None
1270            } else {
1271                Some(value)
1272            }
1273        }
1274
1275        /// REQUIRED enum
1276        #[inline]
1277        pub fn peg_price_type(&self) -> peg_price_type::PegPriceType {
1278            if self.acting_version() < 1 {
1279                return peg_price_type::PegPriceType::default();
1280            }
1281
1282            self.get_buf().get_u8_at(self.offset + 270).into()
1283        }
1284
1285        /// REQUIRED enum
1286        #[inline]
1287        pub fn peg_offset_type(&self) -> peg_offset_type::PegOffsetType {
1288            if self.acting_version() < 1 {
1289                return peg_offset_type::PegOffsetType::default();
1290            }
1291
1292            self.get_buf().get_u8_at(self.offset + 271).into()
1293        }
1294
1295        /// primitive field - 'OPTIONAL' { null_value: '0xff_u8' }
1296        #[inline]
1297        pub fn peg_offset_value(&self) -> Option<u8> {
1298            if self.acting_version() < 1 {
1299                return None;
1300            }
1301
1302            let value = self.get_buf().get_u8_at(self.offset + 272);
1303            if value == 0xff_u8 { None } else { Some(value) }
1304        }
1305
1306        /// primitive field - 'OPTIONAL' { null_value: '-9223372036854775808_i64' }
1307        #[inline]
1308        pub fn pegged_price(&self) -> Option<i64> {
1309            if self.acting_version() < 1 {
1310                return None;
1311            }
1312
1313            let value = self.get_buf().get_i64_at(self.offset + 273);
1314            if value == -9223372036854775808_i64 {
1315                None
1316            } else {
1317                Some(value)
1318            }
1319        }
1320
1321        /// REQUIRED enum
1322        #[inline]
1323        pub fn expiry_reason(&self) -> expiry_reason::ExpiryReason {
1324            if self.acting_version() < 3 {
1325                return expiry_reason::ExpiryReason::default();
1326            }
1327
1328            self.get_buf().get_u8_at(self.offset + 281).into()
1329        }
1330
1331        /// VAR_DATA DECODER - character encoding: 'UTF-8'
1332        #[inline]
1333        pub fn symbol_decoder(&mut self) -> (usize, usize) {
1334            let offset = self.get_limit();
1335            let data_length = self.get_buf().get_u8_at(offset) as usize;
1336            self.set_limit(offset + 1 + data_length);
1337            (offset + 1, data_length)
1338        }
1339
1340        #[inline]
1341        pub fn symbol_slice(&'a self, coordinates: (usize, usize)) -> &'a [u8] {
1342            debug_assert!(self.get_limit() >= coordinates.0 + coordinates.1);
1343            self.get_buf().get_slice_at(coordinates.0, coordinates.1)
1344        }
1345
1346        /// VAR_DATA DECODER - character encoding: 'UTF-8'
1347        #[inline]
1348        pub fn client_order_id_decoder(&mut self) -> (usize, usize) {
1349            let offset = self.get_limit();
1350            let data_length = self.get_buf().get_u8_at(offset) as usize;
1351            self.set_limit(offset + 1 + data_length);
1352            (offset + 1, data_length)
1353        }
1354
1355        #[inline]
1356        pub fn client_order_id_slice(&'a self, coordinates: (usize, usize)) -> &'a [u8] {
1357            debug_assert!(self.get_limit() >= coordinates.0 + coordinates.1);
1358            self.get_buf().get_slice_at(coordinates.0, coordinates.1)
1359        }
1360
1361        /// VAR_DATA DECODER - character encoding: 'UTF-8'
1362        #[inline]
1363        pub fn orig_client_order_id_decoder(&mut self) -> (usize, usize) {
1364            let offset = self.get_limit();
1365            let data_length = self.get_buf().get_u8_at(offset) as usize;
1366            self.set_limit(offset + 1 + data_length);
1367            (offset + 1, data_length)
1368        }
1369
1370        #[inline]
1371        pub fn orig_client_order_id_slice(&'a self, coordinates: (usize, usize)) -> &'a [u8] {
1372            debug_assert!(self.get_limit() >= coordinates.0 + coordinates.1);
1373            self.get_buf().get_slice_at(coordinates.0, coordinates.1)
1374        }
1375
1376        /// VAR_DATA DECODER - character encoding: 'UTF-8'
1377        #[inline]
1378        pub fn commission_asset_decoder(&mut self) -> (usize, usize) {
1379            let offset = self.get_limit();
1380            let data_length = self.get_buf().get_u8_at(offset) as usize;
1381            self.set_limit(offset + 1 + data_length);
1382            (offset + 1, data_length)
1383        }
1384
1385        #[inline]
1386        pub fn commission_asset_slice(&'a self, coordinates: (usize, usize)) -> &'a [u8] {
1387            debug_assert!(self.get_limit() >= coordinates.0 + coordinates.1);
1388            self.get_buf().get_slice_at(coordinates.0, coordinates.1)
1389        }
1390
1391        /// VAR_DATA DECODER - character encoding: 'UTF-8'
1392        #[inline]
1393        pub fn reject_reason_decoder(&mut self) -> (usize, usize) {
1394            let offset = self.get_limit();
1395            let data_length = self.get_buf().get_u8_at(offset) as usize;
1396            self.set_limit(offset + 1 + data_length);
1397            (offset + 1, data_length)
1398        }
1399
1400        #[inline]
1401        pub fn reject_reason_slice(&'a self, coordinates: (usize, usize)) -> &'a [u8] {
1402            debug_assert!(self.get_limit() >= coordinates.0 + coordinates.1);
1403            self.get_buf().get_slice_at(coordinates.0, coordinates.1)
1404        }
1405
1406        /// VAR_DATA DECODER - character encoding: 'UTF-8'
1407        #[inline]
1408        pub fn counter_symbol_decoder(&mut self) -> (usize, usize) {
1409            let offset = self.get_limit();
1410            let data_length = self.get_buf().get_u8_at(offset) as usize;
1411            self.set_limit(offset + 1 + data_length);
1412            (offset + 1, data_length)
1413        }
1414
1415        #[inline]
1416        pub fn counter_symbol_slice(&'a self, coordinates: (usize, usize)) -> &'a [u8] {
1417            debug_assert!(self.get_limit() >= coordinates.0 + coordinates.1);
1418            self.get_buf().get_slice_at(coordinates.0, coordinates.1)
1419        }
1420    }
1421} // end decoder