Skip to main content

nautilus_binance/spot/sbe/generated/
cancel_order_response_codec.rs

1pub use decoder::CancelOrderResponseDecoder;
2pub use encoder::CancelOrderResponseEncoder;
3
4use super::*;
5pub use super::{SBE_SCHEMA_ID, SBE_SCHEMA_VERSION, SBE_SEMANTIC_VERSION};
6
7pub const SBE_BLOCK_LENGTH: u16 = 137;
8pub const SBE_TEMPLATE_ID: u16 = 305;
9
10pub mod encoder {
11    use message_header_codec::*;
12
13    use super::*;
14
15    #[derive(Debug, Default)]
16    pub struct CancelOrderResponseEncoder<'a> {
17        buf: WriteBuf<'a>,
18        initial_offset: usize,
19        offset: usize,
20        limit: usize,
21    }
22
23    impl<'a> Writer<'a> for CancelOrderResponseEncoder<'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 CancelOrderResponseEncoder<'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> CancelOrderResponseEncoder<'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 'priceExponent'
67        /// - min value: -127
68        /// - max value: 127
69        /// - null value: -128_i8
70        /// - characterEncoding: null
71        /// - semanticType: null
72        /// - encodedOffset: 0
73        /// - encodedLength: 1
74        /// - version: 0
75        #[inline]
76        pub fn price_exponent(&mut self, value: i8) {
77            let offset = self.offset;
78            self.get_buf_mut().put_i8_at(offset, value);
79        }
80
81        /// primitive field 'qtyExponent'
82        /// - min value: -127
83        /// - max value: 127
84        /// - null value: -128_i8
85        /// - characterEncoding: null
86        /// - semanticType: null
87        /// - encodedOffset: 1
88        /// - encodedLength: 1
89        /// - version: 0
90        #[inline]
91        pub fn qty_exponent(&mut self, value: i8) {
92            let offset = self.offset + 1;
93            self.get_buf_mut().put_i8_at(offset, value);
94        }
95
96        /// primitive field 'orderId'
97        /// - min value: -9223372036854775807
98        /// - max value: 9223372036854775807
99        /// - null value: -9223372036854775808_i64
100        /// - characterEncoding: null
101        /// - semanticType: null
102        /// - encodedOffset: 2
103        /// - encodedLength: 8
104        /// - version: 0
105        #[inline]
106        pub fn order_id(&mut self, value: i64) {
107            let offset = self.offset + 2;
108            self.get_buf_mut().put_i64_at(offset, value);
109        }
110
111        /// primitive field 'orderListId'
112        /// - min value: -9223372036854775807
113        /// - max value: 9223372036854775807
114        /// - null value: -9223372036854775808_i64
115        /// - characterEncoding: null
116        /// - semanticType: null
117        /// - encodedOffset: 10
118        /// - encodedLength: 8
119        /// - version: 0
120        #[inline]
121        pub fn order_list_id(&mut self, value: i64) {
122            let offset = self.offset + 10;
123            self.get_buf_mut().put_i64_at(offset, value);
124        }
125
126        /// primitive field 'transactTime'
127        /// - min value: -9223372036854775807
128        /// - max value: 9223372036854775807
129        /// - null value: -9223372036854775808_i64
130        /// - characterEncoding: null
131        /// - semanticType: null
132        /// - encodedOffset: 18
133        /// - encodedLength: 8
134        /// - version: 0
135        #[inline]
136        pub fn transact_time(&mut self, value: i64) {
137            let offset = self.offset + 18;
138            self.get_buf_mut().put_i64_at(offset, value);
139        }
140
141        /// primitive field 'price'
142        /// - min value: -9223372036854775807
143        /// - max value: 9223372036854775807
144        /// - null value: -9223372036854775808_i64
145        /// - characterEncoding: null
146        /// - semanticType: null
147        /// - encodedOffset: 26
148        /// - encodedLength: 8
149        /// - version: 0
150        #[inline]
151        pub fn price(&mut self, value: i64) {
152            let offset = self.offset + 26;
153            self.get_buf_mut().put_i64_at(offset, value);
154        }
155
156        /// primitive field 'origQty'
157        /// - min value: -9223372036854775807
158        /// - max value: 9223372036854775807
159        /// - null value: -9223372036854775808_i64
160        /// - characterEncoding: null
161        /// - semanticType: null
162        /// - encodedOffset: 34
163        /// - encodedLength: 8
164        /// - version: 0
165        #[inline]
166        pub fn orig_qty(&mut self, value: i64) {
167            let offset = self.offset + 34;
168            self.get_buf_mut().put_i64_at(offset, value);
169        }
170
171        /// primitive field 'executedQty'
172        /// - min value: -9223372036854775807
173        /// - max value: 9223372036854775807
174        /// - null value: -9223372036854775808_i64
175        /// - characterEncoding: null
176        /// - semanticType: null
177        /// - encodedOffset: 42
178        /// - encodedLength: 8
179        /// - version: 0
180        #[inline]
181        pub fn executed_qty(&mut self, value: i64) {
182            let offset = self.offset + 42;
183            self.get_buf_mut().put_i64_at(offset, value);
184        }
185
186        /// primitive field 'cummulativeQuoteQty'
187        /// - min value: -9223372036854775807
188        /// - max value: 9223372036854775807
189        /// - null value: -9223372036854775808_i64
190        /// - characterEncoding: null
191        /// - semanticType: null
192        /// - encodedOffset: 50
193        /// - encodedLength: 8
194        /// - version: 0
195        #[inline]
196        pub fn cummulative_quote_qty(&mut self, value: i64) {
197            let offset = self.offset + 50;
198            self.get_buf_mut().put_i64_at(offset, value);
199        }
200
201        /// REQUIRED enum
202        #[inline]
203        pub fn status(&mut self, value: order_status::OrderStatus) {
204            let offset = self.offset + 58;
205            self.get_buf_mut().put_u8_at(offset, value as u8)
206        }
207
208        /// REQUIRED enum
209        #[inline]
210        pub fn time_in_force(&mut self, value: time_in_force::TimeInForce) {
211            let offset = self.offset + 59;
212            self.get_buf_mut().put_u8_at(offset, value as u8)
213        }
214
215        /// REQUIRED enum
216        #[inline]
217        pub fn order_type(&mut self, value: order_type::OrderType) {
218            let offset = self.offset + 60;
219            self.get_buf_mut().put_u8_at(offset, value as u8)
220        }
221
222        /// REQUIRED enum
223        #[inline]
224        pub fn side(&mut self, value: order_side::OrderSide) {
225            let offset = self.offset + 61;
226            self.get_buf_mut().put_u8_at(offset, value as u8)
227        }
228
229        /// primitive field 'stopPrice'
230        /// - min value: -9223372036854775807
231        /// - max value: 9223372036854775807
232        /// - null value: -9223372036854775808_i64
233        /// - characterEncoding: null
234        /// - semanticType: null
235        /// - encodedOffset: 62
236        /// - encodedLength: 8
237        /// - version: 0
238        #[inline]
239        pub fn stop_price(&mut self, value: i64) {
240            let offset = self.offset + 62;
241            self.get_buf_mut().put_i64_at(offset, value);
242        }
243
244        /// primitive field 'trailingDelta'
245        /// - min value: -9223372036854775807
246        /// - max value: 9223372036854775807
247        /// - null value: -9223372036854775808_i64
248        /// - characterEncoding: null
249        /// - semanticType: null
250        /// - encodedOffset: 70
251        /// - encodedLength: 8
252        /// - version: 0
253        #[inline]
254        pub fn trailing_delta(&mut self, value: i64) {
255            let offset = self.offset + 70;
256            self.get_buf_mut().put_i64_at(offset, value);
257        }
258
259        /// primitive field 'trailingTime'
260        /// - min value: -9223372036854775807
261        /// - max value: 9223372036854775807
262        /// - null value: -9223372036854775808_i64
263        /// - characterEncoding: null
264        /// - semanticType: null
265        /// - encodedOffset: 78
266        /// - encodedLength: 8
267        /// - version: 0
268        #[inline]
269        pub fn trailing_time(&mut self, value: i64) {
270            let offset = self.offset + 78;
271            self.get_buf_mut().put_i64_at(offset, value);
272        }
273
274        /// primitive field 'icebergQty'
275        /// - min value: -9223372036854775807
276        /// - max value: 9223372036854775807
277        /// - null value: -9223372036854775808_i64
278        /// - characterEncoding: null
279        /// - semanticType: null
280        /// - encodedOffset: 86
281        /// - encodedLength: 8
282        /// - version: 0
283        #[inline]
284        pub fn iceberg_qty(&mut self, value: i64) {
285            let offset = self.offset + 86;
286            self.get_buf_mut().put_i64_at(offset, value);
287        }
288
289        /// primitive field 'strategyId'
290        /// - min value: -9223372036854775807
291        /// - max value: 9223372036854775807
292        /// - null value: -9223372036854775808_i64
293        /// - characterEncoding: null
294        /// - semanticType: null
295        /// - encodedOffset: 94
296        /// - encodedLength: 8
297        /// - version: 0
298        #[inline]
299        pub fn strategy_id(&mut self, value: i64) {
300            let offset = self.offset + 94;
301            self.get_buf_mut().put_i64_at(offset, value);
302        }
303
304        /// primitive field 'strategyType'
305        /// - min value: -2147483647
306        /// - max value: 2147483647
307        /// - null value: -2147483648_i32
308        /// - characterEncoding: null
309        /// - semanticType: null
310        /// - encodedOffset: 102
311        /// - encodedLength: 4
312        /// - version: 0
313        #[inline]
314        pub fn strategy_type(&mut self, value: i32) {
315            let offset = self.offset + 102;
316            self.get_buf_mut().put_i32_at(offset, value);
317        }
318
319        /// REQUIRED enum
320        #[inline]
321        pub fn order_capacity(&mut self, value: order_capacity::OrderCapacity) {
322            let offset = self.offset + 106;
323            self.get_buf_mut().put_u8_at(offset, value as u8)
324        }
325
326        /// REQUIRED enum
327        #[inline]
328        pub fn working_floor(&mut self, value: floor::Floor) {
329            let offset = self.offset + 107;
330            self.get_buf_mut().put_u8_at(offset, value as u8)
331        }
332
333        /// REQUIRED enum
334        #[inline]
335        pub fn self_trade_prevention_mode(
336            &mut self,
337            value: self_trade_prevention_mode::SelfTradePreventionMode,
338        ) {
339            let offset = self.offset + 108;
340            self.get_buf_mut().put_u8_at(offset, value as u8)
341        }
342
343        /// primitive field 'preventedQuantity'
344        /// - min value: -9223372036854775807
345        /// - max value: 9223372036854775807
346        /// - null value: -9223372036854775808_i64
347        /// - characterEncoding: null
348        /// - semanticType: null
349        /// - encodedOffset: 109
350        /// - encodedLength: 8
351        /// - version: 0
352        #[inline]
353        pub fn prevented_quantity(&mut self, value: i64) {
354            let offset = self.offset + 109;
355            self.get_buf_mut().put_i64_at(offset, value);
356        }
357
358        /// REQUIRED enum
359        #[inline]
360        pub fn used_sor(&mut self, value: bool_enum::BoolEnum) {
361            let offset = self.offset + 117;
362            self.get_buf_mut().put_u8_at(offset, value as u8)
363        }
364
365        /// primitive field 'origQuoteOrderQty'
366        /// - min value: -9223372036854775807
367        /// - max value: 9223372036854775807
368        /// - null value: -9223372036854775808_i64
369        /// - characterEncoding: null
370        /// - semanticType: null
371        /// - encodedOffset: 118
372        /// - encodedLength: 8
373        /// - version: 0
374        #[inline]
375        pub fn orig_quote_order_qty(&mut self, value: i64) {
376            let offset = self.offset + 118;
377            self.get_buf_mut().put_i64_at(offset, value);
378        }
379
380        /// REQUIRED enum
381        #[inline]
382        pub fn peg_price_type(&mut self, value: peg_price_type::PegPriceType) {
383            let offset = self.offset + 126;
384            self.get_buf_mut().put_u8_at(offset, value as u8)
385        }
386
387        /// REQUIRED enum
388        #[inline]
389        pub fn peg_offset_type(&mut self, value: peg_offset_type::PegOffsetType) {
390            let offset = self.offset + 127;
391            self.get_buf_mut().put_u8_at(offset, value as u8)
392        }
393
394        /// primitive field 'pegOffsetValue'
395        /// - min value: 0
396        /// - max value: 254
397        /// - null value: 0xff_u8
398        /// - characterEncoding: null
399        /// - semanticType: null
400        /// - encodedOffset: 128
401        /// - encodedLength: 1
402        /// - version: 1
403        #[inline]
404        pub fn peg_offset_value(&mut self, value: u8) {
405            let offset = self.offset + 128;
406            self.get_buf_mut().put_u8_at(offset, value);
407        }
408
409        /// primitive field 'peggedPrice'
410        /// - min value: -9223372036854775807
411        /// - max value: 9223372036854775807
412        /// - null value: -9223372036854775808_i64
413        /// - characterEncoding: null
414        /// - semanticType: null
415        /// - encodedOffset: 129
416        /// - encodedLength: 8
417        /// - version: 1
418        #[inline]
419        pub fn pegged_price(&mut self, value: i64) {
420            let offset = self.offset + 129;
421            self.get_buf_mut().put_i64_at(offset, value);
422        }
423
424        /// VAR_DATA ENCODER - character encoding: 'UTF-8'
425        #[inline]
426        pub fn symbol(&mut self, value: &str) {
427            let limit = self.get_limit();
428            let data_length = value.len();
429            self.set_limit(limit + 1 + data_length);
430            self.get_buf_mut().put_u8_at(limit, data_length as u8);
431            self.get_buf_mut().put_slice_at(limit + 1, value.as_bytes());
432        }
433
434        /// VAR_DATA ENCODER - character encoding: 'UTF-8'
435        #[inline]
436        pub fn orig_client_order_id(&mut self, value: &str) {
437            let limit = self.get_limit();
438            let data_length = value.len();
439            self.set_limit(limit + 1 + data_length);
440            self.get_buf_mut().put_u8_at(limit, data_length as u8);
441            self.get_buf_mut().put_slice_at(limit + 1, value.as_bytes());
442        }
443
444        /// VAR_DATA ENCODER - character encoding: 'UTF-8'
445        #[inline]
446        pub fn client_order_id(&mut self, value: &str) {
447            let limit = self.get_limit();
448            let data_length = value.len();
449            self.set_limit(limit + 1 + data_length);
450            self.get_buf_mut().put_u8_at(limit, data_length as u8);
451            self.get_buf_mut().put_slice_at(limit + 1, value.as_bytes());
452        }
453    }
454} // end encoder
455
456pub mod decoder {
457    use message_header_codec::*;
458
459    use super::*;
460
461    #[derive(Clone, Copy, Debug, Default)]
462    pub struct CancelOrderResponseDecoder<'a> {
463        buf: ReadBuf<'a>,
464        initial_offset: usize,
465        offset: usize,
466        limit: usize,
467        pub acting_block_length: u16,
468        pub acting_version: u16,
469    }
470
471    impl ActingVersion for CancelOrderResponseDecoder<'_> {
472        #[inline]
473        fn acting_version(&self) -> u16 {
474            self.acting_version
475        }
476    }
477
478    impl<'a> Reader<'a> for CancelOrderResponseDecoder<'a> {
479        #[inline]
480        fn get_buf(&self) -> &ReadBuf<'a> {
481            &self.buf
482        }
483    }
484
485    impl<'a> Decoder<'a> for CancelOrderResponseDecoder<'a> {
486        #[inline]
487        fn get_limit(&self) -> usize {
488            self.limit
489        }
490
491        #[inline]
492        fn set_limit(&mut self, limit: usize) {
493            self.limit = limit;
494        }
495    }
496
497    impl<'a> CancelOrderResponseDecoder<'a> {
498        pub fn wrap(
499            mut self,
500            buf: ReadBuf<'a>,
501            offset: usize,
502            acting_block_length: u16,
503            acting_version: u16,
504        ) -> Self {
505            let limit = offset + acting_block_length as usize;
506            self.buf = buf;
507            self.initial_offset = offset;
508            self.offset = offset;
509            self.limit = limit;
510            self.acting_block_length = acting_block_length;
511            self.acting_version = acting_version;
512            self
513        }
514
515        #[inline]
516        pub fn encoded_length(&self) -> usize {
517            self.limit - self.offset
518        }
519
520        pub fn header(self, mut header: MessageHeaderDecoder<ReadBuf<'a>>, offset: usize) -> Self {
521            debug_assert_eq!(SBE_TEMPLATE_ID, header.template_id());
522            let acting_block_length = header.block_length();
523            let acting_version = header.version();
524
525            self.wrap(
526                header.parent().unwrap(),
527                offset + message_header_codec::ENCODED_LENGTH,
528                acting_block_length,
529                acting_version,
530            )
531        }
532
533        /// primitive field - 'REQUIRED'
534        #[inline]
535        pub fn price_exponent(&self) -> i8 {
536            self.get_buf().get_i8_at(self.offset)
537        }
538
539        /// primitive field - 'REQUIRED'
540        #[inline]
541        pub fn qty_exponent(&self) -> i8 {
542            self.get_buf().get_i8_at(self.offset + 1)
543        }
544
545        /// primitive field - 'REQUIRED'
546        #[inline]
547        pub fn order_id(&self) -> i64 {
548            self.get_buf().get_i64_at(self.offset + 2)
549        }
550
551        /// primitive field - 'OPTIONAL' { null_value: '-9223372036854775808_i64' }
552        #[inline]
553        pub fn order_list_id(&self) -> Option<i64> {
554            let value = self.get_buf().get_i64_at(self.offset + 10);
555            if value == -9223372036854775808_i64 {
556                None
557            } else {
558                Some(value)
559            }
560        }
561
562        /// primitive field - 'REQUIRED'
563        #[inline]
564        pub fn transact_time(&self) -> i64 {
565            self.get_buf().get_i64_at(self.offset + 18)
566        }
567
568        /// primitive field - 'REQUIRED'
569        #[inline]
570        pub fn price(&self) -> i64 {
571            self.get_buf().get_i64_at(self.offset + 26)
572        }
573
574        /// primitive field - 'REQUIRED'
575        #[inline]
576        pub fn orig_qty(&self) -> i64 {
577            self.get_buf().get_i64_at(self.offset + 34)
578        }
579
580        /// primitive field - 'REQUIRED'
581        #[inline]
582        pub fn executed_qty(&self) -> i64 {
583            self.get_buf().get_i64_at(self.offset + 42)
584        }
585
586        /// primitive field - 'REQUIRED'
587        #[inline]
588        pub fn cummulative_quote_qty(&self) -> i64 {
589            self.get_buf().get_i64_at(self.offset + 50)
590        }
591
592        /// REQUIRED enum
593        #[inline]
594        pub fn status(&self) -> order_status::OrderStatus {
595            self.get_buf().get_u8_at(self.offset + 58).into()
596        }
597
598        /// REQUIRED enum
599        #[inline]
600        pub fn time_in_force(&self) -> time_in_force::TimeInForce {
601            self.get_buf().get_u8_at(self.offset + 59).into()
602        }
603
604        /// REQUIRED enum
605        #[inline]
606        pub fn order_type(&self) -> order_type::OrderType {
607            self.get_buf().get_u8_at(self.offset + 60).into()
608        }
609
610        /// REQUIRED enum
611        #[inline]
612        pub fn side(&self) -> order_side::OrderSide {
613            self.get_buf().get_u8_at(self.offset + 61).into()
614        }
615
616        /// primitive field - 'OPTIONAL' { null_value: '-9223372036854775808_i64' }
617        #[inline]
618        pub fn stop_price(&self) -> Option<i64> {
619            let value = self.get_buf().get_i64_at(self.offset + 62);
620            if value == -9223372036854775808_i64 {
621                None
622            } else {
623                Some(value)
624            }
625        }
626
627        /// primitive field - 'OPTIONAL' { null_value: '-9223372036854775808_i64' }
628        #[inline]
629        pub fn trailing_delta(&self) -> Option<i64> {
630            let value = self.get_buf().get_i64_at(self.offset + 70);
631            if value == -9223372036854775808_i64 {
632                None
633            } else {
634                Some(value)
635            }
636        }
637
638        /// primitive field - 'OPTIONAL' { null_value: '-9223372036854775808_i64' }
639        #[inline]
640        pub fn trailing_time(&self) -> Option<i64> {
641            let value = self.get_buf().get_i64_at(self.offset + 78);
642            if value == -9223372036854775808_i64 {
643                None
644            } else {
645                Some(value)
646            }
647        }
648
649        /// primitive field - 'OPTIONAL' { null_value: '-9223372036854775808_i64' }
650        #[inline]
651        pub fn iceberg_qty(&self) -> Option<i64> {
652            let value = self.get_buf().get_i64_at(self.offset + 86);
653            if value == -9223372036854775808_i64 {
654                None
655            } else {
656                Some(value)
657            }
658        }
659
660        /// primitive field - 'OPTIONAL' { null_value: '-9223372036854775808_i64' }
661        #[inline]
662        pub fn strategy_id(&self) -> Option<i64> {
663            let value = self.get_buf().get_i64_at(self.offset + 94);
664            if value == -9223372036854775808_i64 {
665                None
666            } else {
667                Some(value)
668            }
669        }
670
671        /// primitive field - 'OPTIONAL' { null_value: '-2147483648_i32' }
672        #[inline]
673        pub fn strategy_type(&self) -> Option<i32> {
674            let value = self.get_buf().get_i32_at(self.offset + 102);
675            if value == -2147483648_i32 {
676                None
677            } else {
678                Some(value)
679            }
680        }
681
682        /// REQUIRED enum
683        #[inline]
684        pub fn order_capacity(&self) -> order_capacity::OrderCapacity {
685            self.get_buf().get_u8_at(self.offset + 106).into()
686        }
687
688        /// REQUIRED enum
689        #[inline]
690        pub fn working_floor(&self) -> floor::Floor {
691            self.get_buf().get_u8_at(self.offset + 107).into()
692        }
693
694        /// REQUIRED enum
695        #[inline]
696        pub fn self_trade_prevention_mode(
697            &self,
698        ) -> self_trade_prevention_mode::SelfTradePreventionMode {
699            self.get_buf().get_u8_at(self.offset + 108).into()
700        }
701
702        /// primitive field - 'REQUIRED'
703        #[inline]
704        pub fn prevented_quantity(&self) -> i64 {
705            self.get_buf().get_i64_at(self.offset + 109)
706        }
707
708        /// REQUIRED enum
709        #[inline]
710        pub fn used_sor(&self) -> bool_enum::BoolEnum {
711            self.get_buf().get_u8_at(self.offset + 117).into()
712        }
713
714        /// primitive field - 'REQUIRED'
715        #[inline]
716        pub fn orig_quote_order_qty(&self) -> i64 {
717            self.get_buf().get_i64_at(self.offset + 118)
718        }
719
720        /// REQUIRED enum
721        #[inline]
722        pub fn peg_price_type(&self) -> peg_price_type::PegPriceType {
723            if self.acting_version() < 1 {
724                return peg_price_type::PegPriceType::default();
725            }
726
727            self.get_buf().get_u8_at(self.offset + 126).into()
728        }
729
730        /// REQUIRED enum
731        #[inline]
732        pub fn peg_offset_type(&self) -> peg_offset_type::PegOffsetType {
733            if self.acting_version() < 1 {
734                return peg_offset_type::PegOffsetType::default();
735            }
736
737            self.get_buf().get_u8_at(self.offset + 127).into()
738        }
739
740        /// primitive field - 'OPTIONAL' { null_value: '0xff_u8' }
741        #[inline]
742        pub fn peg_offset_value(&self) -> Option<u8> {
743            if self.acting_version() < 1 {
744                return None;
745            }
746
747            let value = self.get_buf().get_u8_at(self.offset + 128);
748            if value == 0xff_u8 { None } else { Some(value) }
749        }
750
751        /// primitive field - 'OPTIONAL' { null_value: '-9223372036854775808_i64' }
752        #[inline]
753        pub fn pegged_price(&self) -> Option<i64> {
754            if self.acting_version() < 1 {
755                return None;
756            }
757
758            let value = self.get_buf().get_i64_at(self.offset + 129);
759            if value == -9223372036854775808_i64 {
760                None
761            } else {
762                Some(value)
763            }
764        }
765
766        /// VAR_DATA DECODER - character encoding: 'UTF-8'
767        #[inline]
768        pub fn symbol_decoder(&mut self) -> (usize, usize) {
769            let offset = self.get_limit();
770            let data_length = self.get_buf().get_u8_at(offset) as usize;
771            self.set_limit(offset + 1 + data_length);
772            (offset + 1, data_length)
773        }
774
775        #[inline]
776        pub fn symbol_slice(&'a self, coordinates: (usize, usize)) -> &'a [u8] {
777            debug_assert!(self.get_limit() >= coordinates.0 + coordinates.1);
778            self.get_buf().get_slice_at(coordinates.0, coordinates.1)
779        }
780
781        /// VAR_DATA DECODER - character encoding: 'UTF-8'
782        #[inline]
783        pub fn orig_client_order_id_decoder(&mut self) -> (usize, usize) {
784            let offset = self.get_limit();
785            let data_length = self.get_buf().get_u8_at(offset) as usize;
786            self.set_limit(offset + 1 + data_length);
787            (offset + 1, data_length)
788        }
789
790        #[inline]
791        pub fn orig_client_order_id_slice(&'a self, coordinates: (usize, usize)) -> &'a [u8] {
792            debug_assert!(self.get_limit() >= coordinates.0 + coordinates.1);
793            self.get_buf().get_slice_at(coordinates.0, coordinates.1)
794        }
795
796        /// VAR_DATA DECODER - character encoding: 'UTF-8'
797        #[inline]
798        pub fn client_order_id_decoder(&mut self) -> (usize, usize) {
799            let offset = self.get_limit();
800            let data_length = self.get_buf().get_u8_at(offset) as usize;
801            self.set_limit(offset + 1 + data_length);
802            (offset + 1, data_length)
803        }
804
805        #[inline]
806        pub fn client_order_id_slice(&'a self, coordinates: (usize, usize)) -> &'a [u8] {
807            debug_assert!(self.get_limit() >= coordinates.0 + coordinates.1);
808            self.get_buf().get_slice_at(coordinates.0, coordinates.1)
809        }
810    }
811} // end decoder